Jump to content
XCOMUFO & Xenocide

Compiling With Ubuntu 7.04 to 8.04


izm

Recommended Posts

I've tried these steps with an older SVN and beta 0.7.1086 on Feisty and beta 0.7.1086 on Gutsy. Seems to work:

  1. get g++:
    sudo apt-get install g++


  2. get expat, zlib, libpng, etc:
    sudo apt-get install zlib1g-dev libvorbis-dev libogg-dev libpng-dev libexpat1-dev


  3. get freetype and subversion (recommended):
    sudo apt-get install libfreetype6-dev subversion


  4. get allegro:
    sudo apt-get install liballegro4.2 liballegro4.2-dev liballegro4.2-plugin-esd


  5. get hawkNL 1.6.8 and extract
    cd to new dir,
    make -f makefile.linux

    then

    sudo make -f makefile.linux install


  6. get Dumb 0.92 ("fixed" version) and extract
    cd to new directory,
    make

    and

    sudo make install

    You will be asked two questions. Say 'Y' when asked if it should support Allegro. When prompted for the path, just push Enter and use the default path, /usr/local/.

  7. update the dynamic linker cache. (See this post )
    add "/usr/local/lib" to /etc/ld.so.conf, if it isn't already there (Feisty users might have to do this)
    sudo echo "/usr/local/lib" >> /etc.ld.so.conf
    sudo ldconfig


  8. get SVN ufo2000 (beta 1071 didn't work, beta 1086 does)
     svn co https://ufo2000.svn.sourceforge.net/svnroot/ufo2000 ufo2000

    and cd into trunk directory OR get the latest beta, extract it, and cd into the root directory of ufo. Note: You will only be able to play people using the same version as you.

  9. make


  10. get sqlite3-dev for server:
    sudo apt-get install libsqlite3-dev


  11. build the server:
    make server


  12. If you had no errors, UFO should be built! Conratulations! :) Look for the ufo2000 and ufo2000-srv executables in the root directory.

Note: I believe make install still does not work for ufo2000, but you should be able to run it straight from the source directory.

 

Troubleshooting Sound

 

The initialization messages flash briefly before the title screen appears. It's very difficult to read these when you're interested in them, and they contain the sound initialization messages. To get these messages printed on the terminal you used to launch the program, edit ufo2000.ini in the game's root directory. Find the flag that says to direct console output to standard output, and set it to 1. Next time you run ufo2000, you will be able to read the initialization messages. Might be a good idea not to have it fullscreen, as well.

 

# Copy init output to stdout
F_LOGTOSTDOUT = 1

 

If you get the following error:

ALSA lib 	rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: No such file or directory

Don't panic. That just means allegro tried to initialize sound with MIDI support, but couldn't detect it (MIDI on linux isn't exactly solid). It will then try to initialize the sound with no MIDI support, and hopefully that will work.

 

Unfortunately, it doesn't seem to work with my setup of Pulseaudio:

 

Error initialising sound system: ALSA: snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) : Invalid argument

 Failed.

 

but most people shouldn't be running that (if you're not sure, chances are you're not running it).

 

If you are running pulseaudio, you can get around it by temporarily killing the pulseaudio daemon.

pulseaudio -k

and starting it again after you're done playing UFO2K.

pulseaudio -D

I've done lots of testing to try and figure out what the problem is, and it could just be my ~/.asoundrc has become a little funky over time. Unfortunately, I have no 'graceful' solution for this... :/ I discovered that forcing allegro to initialize with ESD instead of AUTODETECT (which chooses ALSA) would give me sound while running pulseaudio, but the lag of ESD was not worth it. I believe this is a bug somewhere in Pulseaudio or Allegro, but I'm not sure which. ^.^

 

Hope that helps someone!

Edited by Kratos
Link to comment
Share on other sites

Check the version number in the main screen and do a string search for it? It might be that the version number must be the same for two people to play.

 

Thanks for the suggestions, Bamb. The version number is 1079, and I could host myself fine, so I guess players of different versions aren't allowed to see each other. heh. :)

Link to comment
Share on other sites

Didn't work on (my) Debian Sid. The last make output is attached:

 

g++ -funsigned-char -Wall -Wno-deprecated-declarations -I src/lua -I src/luasqlite3 -DDEBUGMODE -DUFO_SVNVERSION=\"1079\" -O2 -pipe -I/usr/include/freetype2 -DHAVE_FREETYPE -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -DGK_NO_LEGACY -DHAVE_DUMBOGG -DHAVE_PNG -DLINUX -I/usr/include -o ufo2000 obj/bullet.o obj/cell.o obj/config.o obj/connect.o obj/crc32.o obj/dirty.o obj/editor.o obj/explo.o obj/font.o obj/icon.o obj/inventory.o obj/item.o obj/keys.o obj/main.o obj/mainmenu.o obj/map.o obj/map_pathfind.o obj/minimap.o obj/mouse.o obj/multiplay.o obj/music.o obj/packet.o obj/pck.o obj/persist.o obj/place.o obj/platoon.o obj/position.o obj/random.o obj/scenario.o obj/server_gui.o obj/server_protocol.o obj/server_transport.o obj/skin.o obj/soldier.o obj/fpasprite.o obj/gui.o obj/sound.o obj/spk.o obj/stats.o obj/terrapck.o obj/text.o obj/units.o obj/video.o obj/wind.o obj/geoscape.o obj/zfstream.o obj/script_api.o obj/lapi.o obj/lauxlib.o obj/lbaselib.o obj/lcode.o obj/ldblib.o obj/ldebug.o obj/ldo.o obj/ldump.o obj/lfunc.o obj/lgc.o obj/liolib.o obj/llex.o obj/lmathlib.o obj/lmem.o obj/loadlib.o obj/lobject.o obj/lopcodes.o obj/lparser.o obj/lstate.o obj/lstring.o obj/lstrlib.o obj/ltable.o obj/ltablib.o obj/ltests.o obj/ltm.o obj/lundump.o obj/lvm.o obj/lzio.o obj/e_acos.o obj/e_asin.o obj/e_atan2.o obj/e_exp.o obj/e_fmod.o obj/e_log.o obj/e_pow.o obj/e_rem_pio2.o obj/e_remainder.o obj/e_scalb.o obj/e_sqrt.o obj/k_cos.o obj/k_rem_pio2.o obj/k_sin.o obj/k_tan.o obj/s_atan.o obj/s_ceil.o obj/s_copysign.o obj/s_cos.o obj/s_fabs.o obj/s_floor.o obj/s_rint.o obj/s_scalbn.o obj/s_sin.o obj/s_tan.o obj/w_acos.o obj/w_asin.o obj/w_atan2.o obj/w_exp.o obj/w_fmod.o obj/w_log.o obj/w_pow.o obj/w_remainder.o obj/w_sqrt.o obj/md5.o obj/aalg.o obj/aase.o obj/abeos.o obj/abitmap.o obj/agtk.o obj/agup.o obj/ans.o obj/aphoton.o obj/awin95.o obj/decode.o obj/encode.o obj/io.o obj/jpgalleg.o obj/scale2x.o obj/glyph.o obj/dumbogg.o obj/loadpng.o obj/regpng.o obj/savepng.o -lexpat -lfreetype -lz -lvorbisfile -lvorbis -logg -laldmb -ldumb -lpng -lz -lNL -pthread -L/usr/lib -lalleg-4.2.0 -lm -lpthread -lXxf86vm -lXcursor -lXpm -lXext -lX11 -ldl

obj/dumbogg.o: In function `ogg_sigrenderer_get_current_sample':

dumbogg.c:(.text+0x24b): undefined reference to `dumb_resample_get_current_sample'

dumbogg.c:(.text+0x2af): undefined reference to `dumb_resample_get_current_sample'

obj/dumbogg.o: In function `ogg_sigrenderer_get_samples':

dumbogg.c:(.text+0x66c): undefined reference to `dumb_resample'

dumbogg.c:(.text+0x74f): undefined reference to `dumb_resample'

collect2: ld returned 1 exit status

make: *** [ufo2000] Error 1

 

EDIT: It does work with nodumbogg.

Edited by kyevan
Link to comment
Share on other sites

Okay, izm came to irc (quakenet #ufo2000), we tested (I have a windows compiled version, says it's 1079M I think) and it worked!

It was just about the version.

So if you compile yourself from SVN, the other guy has to have an SVN compiled version too.

 

Playing between different OS (win2000, linux) seemed to work fine.

Link to comment
Share on other sites

Didn't work on (my) Debian Sid. The last make output is attached:

 

g++ -funsigned-char -Wall -Wno-deprecated-declarations -I src/lua -I src/luasqlite3 -DDEBUGMODE -DUFO_SVNVERSION=\"1079\" -O2 -pipe -I/usr/include/freetype2 -DHAVE_FREETYPE -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -DGK_NO_LEGACY -DHAVE_DUMBOGG -DHAVE_PNG -DLINUX -I/usr/include -o ufo2000 obj/bullet.o obj/cell.o obj/config.o obj/connect.o obj/crc32.o obj/dirty.o obj/editor.o obj/explo.o obj/font.o obj/icon.o obj/inventory.o obj/item.o obj/keys.o obj/main.o obj/mainmenu.o obj/map.o obj/map_pathfind.o obj/minimap.o obj/mouse.o obj/multiplay.o obj/music.o obj/packet.o obj/pck.o obj/persist.o obj/place.o obj/platoon.o obj/position.o obj/random.o obj/scenario.o obj/server_gui.o obj/server_protocol.o obj/server_transport.o obj/skin.o obj/soldier.o obj/fpasprite.o obj/gui.o obj/sound.o obj/spk.o obj/stats.o obj/terrapck.o obj/text.o obj/units.o obj/video.o obj/wind.o obj/geoscape.o obj/zfstream.o obj/script_api.o obj/lapi.o obj/lauxlib.o obj/lbaselib.o obj/lcode.o obj/ldblib.o obj/ldebug.o obj/ldo.o obj/ldump.o obj/lfunc.o obj/lgc.o obj/liolib.o obj/llex.o obj/lmathlib.o obj/lmem.o obj/loadlib.o obj/lobject.o obj/lopcodes.o obj/lparser.o obj/lstate.o obj/lstring.o obj/lstrlib.o obj/ltable.o obj/ltablib.o obj/ltests.o obj/ltm.o obj/lundump.o obj/lvm.o obj/lzio.o obj/e_acos.o obj/e_asin.o obj/e_atan2.o obj/e_exp.o obj/e_fmod.o obj/e_log.o obj/e_pow.o obj/e_rem_pio2.o obj/e_remainder.o obj/e_scalb.o obj/e_sqrt.o obj/k_cos.o obj/k_rem_pio2.o obj/k_sin.o obj/k_tan.o obj/s_atan.o obj/s_ceil.o obj/s_copysign.o obj/s_cos.o obj/s_fabs.o obj/s_floor.o obj/s_rint.o obj/s_scalbn.o obj/s_sin.o obj/s_tan.o obj/w_acos.o obj/w_asin.o obj/w_atan2.o obj/w_exp.o obj/w_fmod.o obj/w_log.o obj/w_pow.o obj/w_remainder.o obj/w_sqrt.o obj/md5.o obj/aalg.o obj/aase.o obj/abeos.o obj/abitmap.o obj/agtk.o obj/agup.o obj/ans.o obj/aphoton.o obj/awin95.o obj/decode.o obj/encode.o obj/io.o obj/jpgalleg.o obj/scale2x.o obj/glyph.o obj/dumbogg.o obj/loadpng.o obj/regpng.o obj/savepng.o -lexpat -lfreetype -lz -lvorbisfile -lvorbis -logg -laldmb -ldumb -lpng -lz -lNL -pthread -L/usr/lib -lalleg-4.2.0 -lm -lpthread -lXxf86vm -lXcursor -lXpm -lXext -lX11 -ldl

obj/dumbogg.o: In function `ogg_sigrenderer_get_current_sample':

dumbogg.c:(.text+0x24b): undefined reference to `dumb_resample_get_current_sample'

dumbogg.c:(.text+0x2af): undefined reference to `dumb_resample_get_current_sample'

obj/dumbogg.o: In function `ogg_sigrenderer_get_samples':

dumbogg.c:(.text+0x66c): undefined reference to `dumb_resample'

dumbogg.c:(.text+0x74f): undefined reference to `dumb_resample'

collect2: ld returned 1 exit status

make: *** [ufo2000] Error 1

 

EDIT: It does work with nodumbogg.

 

Hi kyevan,

 

Looks like a linker problem. Did you update the runtime bindings after installing the correct version of Dumb? Make sure the line /usr/local/lib (this is where libdumb is installed) is in the file /etc/ld.so.conf. Then run ldconfig to update the cache and try building again.

 

Update: I had the wrong order in the instructions. My bad. Updated. :) Hope that works now.

Edited by izm
Link to comment
Share on other sites

  • 7 months later...

g++ -MMD -funsigned-char -Wall -Wno-deprecated-declarations -I src/lua -I src/luasqlite3 -DDEBUGMODE -DUFO_SVNVERSION=\"1086\" -O2 -pipe -I/usr/include/freetype2 -DHAVE_FREETYPE -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -DGK_NO_LEGACY -DHAVE_DUMBOGG -DHAVE_PNG -DLINUX -I/usr/include -c src/bullet.cpp -o obj/bullet.o
make: g++: Command not found
make: *** [obj/bullet.o] Error 127

Used your methods to compile on ubuntu 7.10 (Gutsy), however received this error. I had to download g++, which some users may get stumped by reading this error. May I suggest adding:

 

sudo apt-get install g++

 

Also, thanks for assisting Ubuntu users! I think I will pin this topic.

Edited by Kratos
Link to comment
Share on other sites

  • 2 months later...

Hi Kratos,

 

I haven't compiled a version, recently, so I'm not sure if it still works with different versions of either Ubuntu or UFO... but.... it looks like the first error is due to not having the required dumbogg development library. That's why you get a different error when you specify not to use it. The second error:

 

gcc -MMD -funsigned-char -Wall -Wno-deprecated-declarations -I src/lua -I src/luasqlite3 -DDEBUGMODE -DUFO_SVNVERSION=\"1086\" -O2 -pipe -I/usr/include/freetype2 -DHAVE_FREETYPE -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -DGK_NO_LEGACY -DHAVE_PNG -DLINUX -I/usr/include -c src/loadpng/loadpng.c -o obj/loadpng.o
******src/loadpng/loadpng.c:8:17: warning: png.h: No such file or directory******
src/loadpng/loadpng.c:22: error: ?Z_BEST_COMPRESSION? ******undeclared****** here (not in a function)
....

 

seems to indicate that you don't have the PNG development library, libpng-dev. Are you sure you installed that package? It shouldn't be necessary, but you can try running "ldconfig" after installing the package, just to make sure the paths were updated.

 

I thought g++ would have been pulled in as a dependency, but I guess not. I'll add it to the post, thanks.

Link to comment
Share on other sites

  • 3 months later...
Sorry, I thought I had edited the post to include more, guess it didn't go through =/ I'm on ubuntu 8.04. I did get an error message at one point, but it was fixed when I ran 'sudo apt-get install libpng-dev' again. Was able to compile after that with no errors. But when I launched the compiled game my monitor told me the 'signal was out of range' and displayed a black screen. I'm going to try this again tomorrow.
Link to comment
Share on other sites

This sounds like either a monitor/video card issue. I could be wrong, though.

 

What is the specs of your video card? Do you have the appropriate drivers installed/activated for it? In Ubuntu, some drivers are not always present or activated by default (such as Nvidia) and you may have to download them and activate them. Check 'Hardware Drivers' (System -> Administration) to see if you have any inactive video drivers. Usually you can find something of this sort under 'Synaptic Package Manger' or simply "checking" the box to enable the driver (automatically will find support).

 

Try running 'glxgears' in the terminal and tell me if you can view three gears moving in a separate window. You should be able to see your fps in the terminal.

 

If I am talking to somebody who already knows this basic information or isn't inexperienced to Linux, tell me to stop rambling. :)

 

Edit: Sorry for not mentioning this, I was very tired when I wrote this post, but what ufo2000 build are you compiling? If you used the above method of achieving ufo2000 through SVN, is your current directory 'ufo2000/trunk'? This is where the latest revision is. However, if you download the through SVN, your entire /ufo2000 directory will be only accessible through root. You might want to stick to just downloading the sources (0.7.1086) directly off the homepage if you are here to play without the care of building a new revision, since they are less strict of permissions and are not required to be under root.

 

If you want to build the latest revision, however, after compile, did you try running the game from the terminal? As mentioned above, you can only access the contents of the directory under root. You can execute the program through './ufo2000' while in the same directory as /trunk.

Edited by Kratos
Link to comment
Share on other sites

I appreciate the help, I'm very very new to linux. I've got an NVidia GeForce 7800 card. The drivers are enabled in 'Hardware Drivers'. It' using the 'NVidia binary X.Org driver ('new' driver)'. I also tried the 'NVidia binary X.Org driver' to see if the new one wasn't working right. Both give the same problem, 'Signal Over Range' message on my monitor when I start the game.

 

glxgears displays fine and runs at about 10,000 fps. Also, I'm running compiz-fusion and everything displays fine with that.

 

I'm on a fresh install of linux (with downloaded updates) as of today, so I went thru the post again. I got a error when I tried to 'make' inside the dumb directory, so I used 'sudo make' instead and it finished without the error. Other than that I saw no errors.

 

Both times I've tried to compile the game I've used the source downloaded (0.7.1086) off the home page rather than using 'svn co https://ufo2000.svn.sourceforge.net/svnroot/ufo2000 ufo2000'.

 

Any ideas? =/

Link to comment
Share on other sites

Well... here's a start... My resolution is currently set to 1280x1024 and I can't set a refresh rate of anything but 50 or 51Hz. Someone told me the Signal Over Range probably had to do with the refresh rate. So I edited my /etc/X11/xorg.conf to try and add 70Hz to my 1280x1024 display. Instead I think I broke it, because when I reset linux (ctrl+alt+backspace), it had to boot itself twice. When I got into linux the only displays I could select were 800x600 and one that was even lower. But the refresh rate was above 60Hz. I launched xcom and it worked, LOL. Loaded perfectly.

 

So, I then loaded my backup xorg.conf and reset the computer. My display options came back to normal. I set the display to 800x600 and the refresh to 67Hz (which was the max) and tried to load ufo2k. Not only did it not work, but now I can't seem to escape out =/ Not sure exactly what to try now...

 

 

Edit: I changed the flag so it doesn't start fullscreen and it loads in a window and works....

Edited by DrLame
Link to comment
Share on other sites

My resolution is also 1280x1024. Change it back and lets test a few more things.

 

Increase ufo2000's screen resolution to 1024x768 and run it. Then attempt 1280x1024. What are your results?

 

Now try without compiz-fusion the same process.

 

Note: You can change resolution by finding these lines in 'ufo2000.ini':

 

screen_x_res = 800
screen_y_res = 600

 

I launched xcom and it worked, LOL. Loaded perfectly.

X-com or ufo2000? I assume you mean ufo2000?

Link to comment
Share on other sites

  • 11 months later...

Hello, I tried to compile latest UFO200 beta (0.9.1105) on Ubuntu Hardy Heron 8.04 but I get some sound related error:

 

src/stdafx.h:89:19: warning: expat.h: No such file or directory
src/sound.cpp:674: błąd: `XML_Parser, does not name a type
src/sound.cpp:689: błąd: expected initializer before `*, token
src/sound.cpp:176: warning: `const char* getSymString(SoundSym_e_t), defined but not used
make: *** [obj/sound.o] Error 1

I never occurred such error in previous stable( 6.06) version of Ubuntu.

Link to comment
Share on other sites

Hello, I tried to compile latest UFO200 beta (0.9.1105) on Ubuntu Hardy Heron 8.04 but I get some sound related error:

 

src/stdafx.h:89:19: warning: expat.h: No such file or directory
src/sound.cpp:674: błąd: `XML_Parser, does not name a type
src/sound.cpp:689: błąd: expected initializer before `*, token
src/sound.cpp:176: warning: `const char* getSymString(SoundSym_e_t), defined but not used
make: *** [obj/sound.o] Error 1

I never occurred such error in previous stable( 6.06) version of Ubuntu.

Looks like you just had libexpat1-dev installed in your previous version of ubuntu.

Link to comment
Share on other sites

  • 10 months later...

Followed the instructions but I get

~/ufo2000$ make

g++ -MMD -funsigned-char -Wall -Wno-deprecated-declarations -I src/lua -I src/luasqlite3 -DDEBUGMODE -DUFO_SVNVERSION=\"exported\" -O2 -pipe -I/usr/include/freetype2 -DHAVE_FREETYPE -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -DGK_NO_LEGACY -DHAVE_PNG -DLINUX -I/usr/include -c src/bullet.cpp -o obj/bullet.o

In file included from src/stdafx.h:33,

from src/bullet.cpp:22:

/usr/local/include/nl.h:268: error: ?HL_EXP? does not name a type

/usr/local/include/nl.h:270: error: ?HL_EXP? does not name a type

/usr/local/include/nl.h:272: error: ?HL_EXP? does not name a type

etc etc

 

 

Ubuntu 9.10 32-bit.

libpng-dev isn't available but I have libpng12-dev

Edited by bamb
Link to comment
Share on other sites

  • 4 years later...

Just to be clear at first: I didn't read everything from up there to down here. I've just tried to build ufo2k on an Ubuntu 14.04. Didn't work out quite the way like I wanted. It compiles, but when started, throws the following errormessage:

./init-scripts/main.lua:53: attempt to index local `fh' (a nil value)
stack traceback:
    ./init-scripts/main.lua:53: in main chunk

As this thread hasn't been active for quite some time, I imagine, nobody has encountered this problem, or nobody tried to compile ufo2000on Ubuntu fpr the last 4 years. Have there been many changes, or should I really try, what has been written here. Or would that be a waste of time? I just tried it by installing the necessary libs, doing whats written in the Install-file of the source package, and the result, well... see above. And I'm not exactly eager to try all the things above, just to be told, that too much has changed since 2010, to apply it with latest Ubuntu. Whats the current install-guide for ufo2000 on an Ubuntu 14.04 (64 bit?)?

 

Edit:

Just tried to compile the server. Compiling and starting like a charm. Haven't tried to use it, yet.

 

Edit 2:

OK, now I did take the time to test the steps of posting #1, and it didn't work. I get Problems with the part compiling the dumb-library. I went on, just to test how far I'd get without it, and I don't even get the sources from the svn repository:

svn: E175011: Das Projektarchiv wurde permanent nach »https://svn.code.sf.net/p/ufo2000/code/!svn/vcc/default« verschoben; bitte umplatzieren

Meaning, the repository content had been moved to »https://svn.code.sf.net/p/ufo2000/code/!svn/vcc/default«. I tried it with this:

svn co https://svn.code.sf.net/p/ufo2000/code/\!svn/vcc/default ufo2000
Didn't find it anyway:

svn: E170000: Die URL »https://svn.code.sf.net/p/ufo2000/code/!svn/vcc/default« existiert nicht

(Meaning URL doesn't exist.)

 

Just as I expected. Now having a look around, I find the forum mostly deserted. Is the project really dead?

Edited by 7Saturn
Link to comment
Share on other sites

  • 3 months later...

Just for the record: I solved my supposed »compilation«-problem. As it turns out, the error message

./init-scripts/main.lua:53: attempt to index local `fh' (a nil value)
stack traceback:
    ./init-scripts/main.lua:53: in main chunk

was caused by a problematic path with unicode-characters. Aside from that, the code still works rather nicely.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...