News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Help compiling under Ubuntu Hardy 64bit

Started by TimWintle, December 06, 2008, 02:02:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TimWintle

I am trying to compile under Hardy 64-bit.

(I have reverted to revision 2153 since that was the last nightly build, and that runs on my machine)
I'm getting the following errors


===> CXX simgraph8.cc
simgraph8.cc:495: error: conflicting declaration 'int tile_raster_width'
simgraph.h:52: error: 'tile_raster_width' has a previous declaration as 'KOORD_VAL tile_raster_width'
simgraph8.cc:496: error: conflicting declaration 'int base_tile_raster_width'
simgraph.h:55: error: 'base_tile_raster_width' has a previous declaration as 'KOORD_VAL base_tile_raster_width'
simgraph8.cc:1472: warning: unused parameter 'player'
simgraph8.cc: In function 'void display_fb_internal(KOORD_VAL, KOORD_VAL, KOORD_VAL, KOORD_VAL, int, int, KOORD_VAL, KOORD_VAL, KOORD_VAL, KOORD_VAL)':
simgraph8.cc:1699: error: cannot convert 'PIXVAL*' to 'short unsigned int*' in assignment
simgraph8.cc:1701: error: cannot convert 'short unsigned int*' to 'PIXVAL*' in assignment
simgraph8.cc: In function 'int simgraph_init(KOORD_VAL, KOORD_VAL, int, int, int)':
simgraph8.cc:2282: error: cannot convert 'short unsigned int*' to 'PIXVAL*' in assignment
simgraph8.cc:909: error: too many arguments to function 'bool display_load_font(const char*)'
simgraph8.cc:2287: error: at this point in file
make: *** [simgraph8.o] Error 1



My config.default is this:

# OSTYPE must be one of: cygwin mingw beos mac linux freebsd
OSTYPE = linux

# BACKEND must be one of: sdl mixer_sdl allegro gdi x11
# COLOR_DEPTH must be one of: 8 16
BACKEND = sdl
COLOUR_DEPTH = 8

DEBUG = 3    # Level 1-3, higher number means more debug-friendly, see Makefile
OPTIMISE = 1 # Add umpteen optimisation flags
#PROFILE = 1

# other options are:
# HALF_HEIGHT: Enables half height tiles (8 pixel instead 16)
# OTTD_LIKE: Enables half height tiles and crossconnected industries; default folder pak.ttd/
FLAGS =  -DSTEPS16 -DLITTLE_ENDIAN -DUSE_C



am I missing something obvious?

isidoro

You're getting the problems with the 8 bit graphics, perhaps if you change to 16:
COLOUR_DEPTH=16
it gets solved...

This configuration works for me (32-bit hardy, though):
BACKEND = mixer_sdl
COLOUR_DEPTH = 16
OSTYPE = linux
DEBUG = 3    # Level 1-3, higher number means more debug-friendly, see Makefile
OPTIMISE = 0 # Add umpteen optimisation flags
SDL_CONFIG = sdl-config
FLAGS =  -DSTEPS16



TimWintle

Thank you

Changing it to 16 worked perfectly  :D

IgorEliezer

Frankly, I think all useful information that help developers (like this one) should be reunited into a guide or some literature, such as wiki or docs, so programmers can find and have orientation and authonomy about how to "mess" with Simutrans code.

My 2 cents.

puntmuts


BACKEND =sdl
COLOUR_DEPTH = 16
OSTYPE = linux
DEBUG = 1    # Level 1-3, higher number means more debug-friendly, see Makefile
OPTIMISE = 0 # Add umpteen optimisation flags
SDL_CONFIG = sdl-config
FLAGS =  -DSTEPS16  -DLITTLE_ENDIAN -DUSE_C

This config worked for me on r2165 on ArchLinux x64 (current) after all nightly builds were crashing on 32 bits using my pak.german games after the latest ArchLinux updates . Not that r2165 is a very stable version but it compiles fine on my machine.

Long time ST Linux user || Only into ST during late autumn and winter

javagamer

I'm not sure whether I should start a new thread or not, but my question seems relevant so I'll post it.

I'm running Ubuntu Intrepid Ibex AMD64 and following adding -DUSE_C I was able to get simtrans to compile, however when I try to run it I get the following error:
Loading BDF font 'font/Prop-Latin1.bdf'
Unexpected character (255) for 255 character font!
Loading BDF font font/Prop-Latin1.bdf with 255 characters
Reading city configuration ...
Reading speedbonus configuration ...
Reading forest configuration ...
Reading object data from pak/...
Segmentation fault

I am able to play the older version in the Ubuntu repositories, but every time I try running this I get a segfault.  Can anyone help?  This seems like a really cool game and I'd love to be able to play.
Thanks in advance,
-javagamer

vilvoh

Did you installed the proper pakset files?

Escala Real...a blog about Simutrans in Spanish...

prissi

THen compile as 32bit; it will run faster and consume less memory ... But I am not sure what was changed then.

javagamer

#8
I moved all the files from the latest linux release into the source folder, then I downloaded pak64 and it extracted into the pak folder.  I guess I probably shouldn't have abridged the messages I got:
Reading low level config data ...
parse_simuconf() at config/simuconf.tabReading simuconf.tab successful!
Preparing display ...
Screen Flags: requested=10, actual=10
Loading font 'font/prop.fnt'
font/prop.fnt sucessfully loaded as old format prop font!
Init done.
parse_simuconf() at pak/config/simuconf.tabconfig/simuconf.tabReading simuconf.tab successful!
Reading compatibility sound data ...
Loaded /home/javagamer/Games/simutrans_src/pak/sound/bus.wav to sample 0.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/truck.wav to sample 1.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/diesel.wav to sample 2.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/steam.wav to sample 3.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/boat-horn.wav to sample 4.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/comet-jet.wav to sample 5.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/planelow.wav to sample 6.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/click.wav to sample 7.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/boing.wav to sample 8.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/jackhammer.wav to sample 9.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/gavel.wav to sample 10.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/dock.wav to sample 11.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/explosion.wav to sample 12.
Loaded /home/javagamer/Games/simutrans_src/pak/sound/cash.wav to sample 13.
Loading BDF font 'font/Prop-Latin1.bdf'
Unexpected character (255) for 255 character font!
Loading BDF font font/Prop-Latin1.bdf with 255 characters
Reading city configuration ...
Reading speedbonus configuration ...
Reading forest configuration ...
Reading object data from pak/...
Segmentation fault

I'm pretty sure this shows that the paks are working.  I'm not sure how to compile in 32-bit, anyone know what I need to do?
Also, the latest sourceforge release for linux won't work either.  If I try and run it I get:
javagamer@javagamer-desktop:~/Games/simutrans$ ./simutrans
./simutrans: error while loading shared libraries: libmikmod.so.2: cannot open shared object file: No such file or directory

That's why I decided to try and compile it.

Edit: Before you say it, yes, I do have libmikmod2 and libmikmod2-dev

prissi

I think this is a 32 vs 64 bit conflict. Did you compile with -DDEBUG? This is necessary. You would also get a much more extensive log when starting with simutrans -debug 3

libmikmode2 is a sound library. Just coumpile with sdl (and not mixer_sdl) should take care of that. I think this is a problem of either SDL or SDLmixer.

ansgar

Quote from: javagamer on February 10, 2009, 12:44:19 PM
javagamer@javagamer-desktop:~/Games/simutrans$ ./simutrans
./simutrans: error while loading shared libraries: libmikmod.so.2: cannot open shared object file: No such file or directory


You have probably only 64bit libraries installed.  Mixing 32bit and 64bit binaries does not work, you would need 32bit versions of all libraries.  If you want to use the precompiled simutrans binaries, you would probably have to setup a 32bit chroot environment.

There is also a Debian package for Simutrans 101.0 in experimental which should work.  You would have to compile it yourself:

apt-get install devscripts build-essential debhelper quilt libsdl1.2-dev zlib1g-dev imagemagick libpng12-dev
dget -x http://ftp.de.debian.org/debian/pool/main/s/simutrans/simutrans_101.0-1.dsc
cd simutrans-101.0
debuild


This should give you a simutrans_101.0-1_amd64.deb and simutrans-data_101.0-1_all.deb (and another package for makeobj).

You can then download the PAK64 package from http://packages.debian.org/experimental/simutrans-pak64 (does not need to be recompiled for Ubuntu) and then install both packages with "sudo dpkg -i simutrans-pak64_101.0_all.deb simutrans_101.0_amd64.deb simutrans_101.0_all.deb".

Ansgar

javagamer

Tweaking around with it revealed a make clean;make was able to get everything working.  Further tweaking revealed that uncommenting OPTIMISE = 1 (shouldn't it be OPTIMIZE?) was my problem and leaving it commented was all it took to get it working.  However, possibly related, now I'm getting lots of sporadic freezing which always fixes itself in a few minutes, but makes the game hardly playable.   This can occur even when not doing anything and merely observing.
My config.default is currently (with comments removed):
BACKEND = mixer_sdl
COLOUR_DEPTH = 16
OSTYPE = linux
DEBUG = 1
SDL_CONFIG = sdl-config
VERBOSE = 1
FLAGS =  -DSTEPS16 -DLITTLE_ENDIAN -DUSE_C

As you can see changing to sdl wasn't necessary for it to run, though if it'll make it run better then I certainly can.  (What's the difference between mixer_sdl and regular SDL?   I always thought mixer was an addon to SDL.)  I consider myself a pretty proficient programmer so I don't mind getting pretty involved (though most of my more recent programming has been higher level stuff).
Thanks for all the help so far :)

prissi

The freezing is due to SDLmixer trying to play midi. Either use -no_midi on the command line or just do not use mixer-sdl but only sdl as backend.´

The optimise flag should not, in principle, cause any problem, since I routine also compile without optimisation. BUt I will investigate.

javagamer

Thanks  prissi, I'll try using just sdl, but why won't sdl_mixer play midi?  Is it something I can fix?

prissi

Did you install timidi correctly? (Including a soundfont?) If not, no midi will be played. But it seems SDLmixer works only on half of the systems; many people have this problem.

wernieman

is SDL-mixer for 64 Bit?

I think sdl-mixer only run on 32 Bit-Systems ....
I hope you understand my English

javagamer

I'm pretty sure SDL-mixer is for 64-bit as well.  I know I've needed to install it for other things and never had any problems.  I didn't have that timidi thing though, so that was probably the problem.  I'll try recompiling with mixer_sdl again and see if it works now.

javagamer

Yup, I installed timidi and recompiled and now I can hear the music :)
Though it's probably not worth all that ;)