home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Compilation of original Cube on Ubuntu 10.04 64 bit

by Whales ( Dthdealer ) on 07/13/2010 14:49, 4 messages, last message: 07/14/2010 17:24, 1154 views, last view: 04/21/2024 08:39

I downloaded the pre-compiled version of cube off sourceforge, only to find it did not come with a 64 bit binary. I tries symlinking my libraries to the /usr/lib32 directory, however then the cube_client executable spat out errors about them having the wrong ELF class. Although compiling them from source means I cannot play online, I doubt there is a playerbase for the original cube any more ( unfortunately ).

I downloaded the source from sourceforge, and tried to compile right off but I came across a few problems. Ranging from simple lack of SDL libraries, commenting out sections that would not compile, piggbacking the pre-compiled version's resources to forcing the compilation of code using deprecated functions, here is what I did to get cube to compile.

====
*assuming you are in the directory where BOTH the source and pre-compiled archives are extracted to*

* in other words there should be a folder named 'cube_source' and another 'cube' *

$ sudo apt-get install libgpcl-dev libenet-dev libenet libsdl-mixer1.2-dev libsdl-sound1.2-dev libsdl-image1.2-dev libsdl-dev libstdc++6

* the dependencies of these dependencies should include the build tools AFAIK, as they were already installed ( gcc etc ) *

$ cd cube_source/src

$ nano Makefile

* There are a couple of changes you must make here. The first is on the second line*

* Change *
CXXOPTFLAGS=-Wall -O3 -fsigned-char -fomit-frame-pointer
* to *
CXXOPTFLAGS=-Wall -O3 -fsigned-char -fomit-frame-pointer -fpermissive

* The cube source code uses deprecated features/functions, some of which require this -fpermissive option to exist or GCC says you need to update your code. I'm no programmer! Sorry *

* The other edit you need to make is to stop the compilation of enet - it refuses to compile. Unless I am planning to use multiplayer AFAIK I don't need it - no problems yet *

* Change *
enet:
-make -C ../enet all

clean:
-rm -f $(SERVER_OBJS) $(CLIENT_OBJS) cube_server cube_client
-make -C ../enet/ clean
* to ( notice the two #'s ) *
enet:
# -make -C ../enet all

clean:
-rm -f $(SERVER_OBJS) $(CLIENT_OBJS) cube_server cube_client
# -make -C ../enet/ clean

* Now we can compile! Hurrah! Now just cross your fingers and ignore the countless deprecated feature warnings that flash across your terminal *

$ make

* The binary we need will now be in the current directory *

$ cp cube_client ../../cube/bin_unix/cube_client64

$ cd ../../cube

$ echo "#/bin/sh
cd THISCURRENTDIRECTORY # Needed if accessed by a launcher
exec bin_unix/cube_client64 -wSCREENWIDTH -hSCREENHEIGHT" > launchcube

$ chmod u+x launchcube

* now just execute launchcube from now on to start Cube! *

====

This worked for me, and if it doesn't for you then either I have forgotten something ( please say so ) or you are once again far in the future of the intended audience, with a GCC that cannot eat the old code of cube.


Good hunting guys

   Board Index   

#1: ..

by Nixot on 07/13/2010 15:52

Looking good. I must try this on my other laptop to see if it works.

reply to this message

#2: Spelling errors & Other Notes

by Whales ( Dthdealer ) on 07/14/2010 02:28

A few spelling errors in the above post I did not notice last night, sorry for the inconvenience.

You may need to run _make_ more than once, I'm checking that now. I had to as I staggered the installation of dependencies as was told I needed them. More than likely you don't need the enet dependency either, but it isn't big.

Regards, Whales

reply to this message

#3: Re: Spelling errors & Other Notes

by Whales ( Dthdealer ) on 07/14/2010 02:32, refers to #2

The compilation works fine with a single run of _make_ in under 30 seconds for me. You have to love the simplicity of Cube - I wish Saeur had the zero-compilation that cube has with lighting.

reply to this message

#4: Re: Spelling errors & Other Notes

by Nixot on 07/14/2010 17:24, refers to #3

Me too :P

There's a really early beta (and I mean REALLY early) that has "ad-hoc" vertex lighting similar to Cube but each cube has its own light attribute and you can adjust it with the arrow keys. The release is first one ever to the last "developer_only" release.

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
53872036 visitors requested 71647239 pages
page created in 0.020 seconds using 10 queries
hosted by Boost Digital