VCMI on Linux

The video player is in flux right now. Use svn rev 2281 until it’s fixed.

After updating to Ubuntu 11.10 (amd64, gcc 4.6.1, boost 1.46.1) VCMI compilation fails:

  CXXLD  vcmiclient
/usr/bin/ld: vcmiclient-Client.o: undefined reference to symbol 'boost::system::system_category()'
/usr/bin/ld: note: 'boost::system::system_category()' is defined in DSO /usr/lib/libboost_system.so.1.46.1 so try adding it to the linker command line
/usr/lib/libboost_system.so.1.46.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [vcmiclient] Error 1

Same error goes for vcmiserver.
It looks that gcc is trying to inline some functions which results in these errors. According to config.log -O2 switch was set somewhere.
But there are two things that I still don’t get:

  1. Where this switch is coming from? It was not specified by me so it should come from build system.
  2. Why optimized build results in error? This should be fixed sooner or later.

config.log - pastebin.com/yVQLmu5a

I think they use the new stricter LD.

Add @BOOST_SYSTEM_LIB@ on the LDADD line in client/Makefile.am

I remember that there was a solution for libSDL installed in /usr/lib64 instead of /usr/lib, but I can’t find it anywhere. Could someone repost it?

Try:

Compiling VCMI on ArchLinux x86 fails at linking vcmiclient with the following output:

...
CXXLD  vcmiclient
/usr/bin/ld: vcmiclient-Client.o: undefined reference to symbol 'shm_open@@GLIBC_2.2'
/usr/bin/ld: note: 'shm_open@@GLIBC_2.2' is defined in DSO /lib/librt.so.1 so try adding it to the linker command line
/lib/librt.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [vcmiclient] Error 1
make[2]: Leaving directory `/tmp/heroes3_vcmi/client'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/heroes3_vcmi/client'
make: *** [all-recursive] Error 1

TIA for any helpful hints as to solving this.

It seems the -lrt is needed.
In client/Makefile.am, add -lrt after -lz.

Ivan, you removed it in r2503, what was the reason? May be we need to add a test in configure.in.

Yeah. There is a problem with Mac OS - librt is unavailable on it so there should be some way to check OS and do not add librt for Macs.
Not sure how to do add such test into configure though. Can somebody fix this?