home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Compiling with GCC on FreeBSD

by Dennis on 03/03/2006 03:38, 4 messages, last message: 03/28/2006 05:39, 1127 views, last view: 04/04/2024 22:03

Ok, how can I compile cube on GCC? I always get an error trying to.. I am using FreeBSD to compile.

-Dennis

   Board Index   

#1: ..

by Grogan on 03/08/2006 21:16

Not enough information provided to give you a useful answer. Condolences are all that can usually be offered when a question is posed in this manner.

When asking for help on a build error, you really should include the relevant output from the build process, generally starting at the end of the last successful command, up to and including the failure.

Now fortunately, I compile cube both in Linux and FreeBSD so I might have some tips.

I'm assuming FreeBSD 6 with a modern gcc. You are going to have to add -fpermissive to CXXOPTFLAGS in the Makefile in the src directory. You are also probably going to have to add -I/usr/X11R6/include -I/usr/X11R6/include/GL to the CXXFLAGS variable, and -L/usr/X11R6/lib to the CLIENT_LIBS variable.

Like this:

CXX=g++
CXXOPTFLAGS=-Wall -O3 -fpermissive -fsigned-char -fomit-frame-pointer
CXXFLAGS=$(CXXOPTFLAGS) -I../enet/include -I/usr/X11R6/include -I/usr/X11R6/include/GL `sdl-config --cflags`

CLIENT_LIBS=-L../enet -lenet -L/usr/X11R6/lib `sdl-config --libs` -lSDL_image -lSDL_mixer -lz -lGL -lGLU

Now, you'll have to enter the enet directory above that and make the configure script executable.

cd ../enet

chmod 755 configure

Might as well run it now:

./configure

I always type make in that directory, to be sure that enet is going to be OK before wasting time proceeding with building cube or sauer.

Now you should be able to enter the src directory and type make to build cube.

Also note, you should install the sdl (under devel), sdl_image (under graphics) and sdl_mixer (under audio) packages from ports. There's also a linux bandaid compatibility package for SDL in there that you should install. (sdl_ldbad in devel directory)

I think I also recall seeing an older version of cube available in the ports collection (cube_2004_05_22), if all else fails. Not sure if upgrading the ports collection would give you the current version or not. I don't use FreeBSD much.

reply to this message

#2: thanks

by torg on 03/11/2006 11:43

Danke!

it works good.

I can try tomarrow in linux?

reply to this message

#3: ..

by Grogan on 03/11/2006 18:26

Yes, that should compile exactly the same under Linux. (you don't need -fpermissive for gcc 3.3.x and lower though, only gcc 3.4.x and higher)

reply to this message

#4: ..

by Grogan on 03/28/2006 05:39

Note for anyone compiling Sauerbraten on FreeBSD, you need to type gmake (to use gnu make) instead of make.

I fired up freebsd for the fist time in a while, and went to compile the latest sauerbraten and it fails to find object files if BSD make is used to build it.

Also, for sauerbraten you don't need to use -fpermissive.

The rest should be the same :-)

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53864741 visitors requested 71639885 pages
page created in 0.012 seconds using 10 queries
hosted by Boost Digital