VCMI on Linux

shm_open is in librt. The boost library should have brought in the dependancy. Mine do:

#ldd /usr/lib/libboost_thread-mt.so 
	linux-vdso.so.1 =>  (0x00007fffca9ff000)
	librt.so.1 => /lib/librt.so.1 (0x00007fb1f4e57000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fb1f4b47000)
	libm.so.6 => /lib/libm.so.6 (0x00007fb1f48c2000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fb1f46ab000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x00007fb1f448f000)
	libc.so.6 => /lib/libc.so.6 (0x00007fb1f411f000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fb1f529d000)

If you add LIBS=-lrt to the configure command line, you should be able to pass that hurdle.

Not on the openSuse box:

#ldd /usr/lib64/libboost_thread-mt.so
        linux-vdso.so.1 =>  (0x00007fff95354000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f9b0da3e000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f9b0d826000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9b0d60a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f9b0d2af000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f9b0d059000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9b0df84000)

In any case LIBS=-lrt worked, make ran through, now to test the programs :wink:

This days i have opensuse 10.2 too, and indeed:
./configure LIBS=-lrt --with-boost-libdir=/usr/lib64
compiles, but i don’t quite get the dirs, it used to be easer as i remember. I could run the game through symbolic links to vcmiclient/vcmiserver in Heroes3 directory to where they were built. Now there’s a need to specify more dirs. Supposing I have installed H3+WoG in /usr/local/games/Heroes3 dir, what would be the cleanest install from svn sources of vcmi?

Take a look at the last paragraph in build_data.sh. That should help.

rev 1858

Kubuntu 10.10 Maverick lib error

mati@mati:~/vcmi$ make
make  all-recursive
make[1]: Wejście do katalogu `/home/mati/vcmi'
Making all in lib
make[2]: Wejście do katalogu `/home/mati/vcmi/lib'
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..   -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -pthread -I/usr/include @SDL_CXXFLAGS@ -g -MT libvcmi_la-CConsoleHandler.lo -MD -MP -MF .deps/libvcmi_la-CConsoleHandler.Tpo -c -o libvcmi_la-CConsoleHandler.lo `test -f '../CConsoleHandler.cpp' || echo './'`../CConsoleHandler.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -pthread -I/usr/include @SDL_CXXFLAGS@ -g -MT libvcmi_la-CConsoleHandler.lo -MD -MP -MF .deps/libvcmi_la-CConsoleHandler.Tpo -c ../CConsoleHandler.cpp  -fPIC -DPIC -o .libs/libvcmi_la-CConsoleHandler.o
g++: @SDL_CXXFLAGS@: No such file or directory
In file included from ../stdafx.h:21,
                 from ../CConsoleHandler.cpp:2:
../global.h:47: error: #error DATA_DIR undefined.
../global.h:50: error: #error BIN_DIR undefined.
../global.h:53: error: #error LIB_DIR undefined.
make[2]: *** [libvcmi_la-CConsoleHandler.lo] Błąd 1
make[2]: Opuszczenie katalogu `/home/mati/vcmi/lib'
make[1]: *** [all-recursive] Błąd 1
make[1]: Opuszczenie katalogu `/home/mati/vcmi'
make: *** [all] Błąd 2

i got all dependencies (i think)

I’ve done some work on the build system recently. Do a “make distclean” and run configure again. That should clear it.

distclean won’t help after revision 1861 staill same error makeclean won’t help again

[size=75]2nd post:[/size]

after install 1861 still same error
sorry but I’m need to hurry and sorry for english

[size=75]Moderator’s hint: It’s better if you register on the forum and save your login credentials. Like this you can simply edit your posts if necessary, rather than posting a 2nd time to correct a previous post (plus you won’t need to bother about the security code at every post anymore). ;)[/size]

I have Ubuntu 10.10 and vcmi rev 1861 and it builds fine.

@SDL_CXXFLAGS@ should not appear in the compile line. That’s why I think your system is messed up.

Can you post your config.log ?

Maybe you are using outdated instructions from this thread? Correct version is here:
vcmi.svn.sourceforge.net/svnroo … ADME.linux

Can somebody edit 1st post to add this link?

1st post updated. Let me know if it’s fine.

I have same trouble like Arhat and mati865. I trying to compile vcmi rev.1931 under Ubuntu 10.10.

g++: @SDL_CXXFLAGS@: No such file or directory 

In Russian:
У меня та же беда, что и у Arhat и mati865. Пытаюсь скомпилировать vcmi ревизии 1931 под Убунту 10.10.
2 Ivan и всем русскоговорящим форумчанам, может, стоит открыть тему для обсуждения проекта на родном языке? :smiley:

Something is wrong with build system. Try revert all changes and recompile.
Что-то не так с системой сборки. Попробуйте откатить все изменения и пересобрать:

svn revert -R . 
./configure 
make 

Если без изменений - выложите файл config.log
По поводу русской темы - неплохая идея. Думаю создам такую сегодня-завтра. Как раз хотел пособирать оставшиеся проблемы с локализацией.

It seems that your advice has helped with the previous error, but the assembly stops at vcmi_client.

In russian:
Похоже, что ваш совет помог с предыдущей ошибкой, однако на сборка останавливается на vcmi_client.
dl.dropbox.com/u/19480975/config.log

Making all in client
make[1]: Вход в каталог /home/konrad/vcmi/client' CXX vcmiclient-CMusicHandler.o ../hch/CMusicHandler.cpp:8: fatal error: SDL_mixer.h: Нет такого файла или каталога compilation terminated. make[1]: *** [vcmiclient-CMusicHandler.o] Ошибка 1 make[1]: Выход из каталога/home/konrad/vcmi/client’
make: *** [all-recursive] Ошибка 1

libsdl-mixer1.2-dev установлено.

Теперь чтот не так с SDL
Посмотрите куда был установлен этот файл:
dpkg -L libsdl-mixer1.2-dev
В выводе должна быть строка вида
**/usr/include/SDL/**SDL_mixer.h

Судя по логу он ищется в папке /usr/local/include/SDL
Если этой папки нет или пустая - создаем ссылку на папку с SDL_mixer.h:
sudo ln -fs /usr/include/SDL /usr/local/include
и пробуем собрать клиент:
make

Если же папка не пустая - кроме как попробовать переустановить все dev-пакеты связанные с SDL идей больше нет.

Думаю лучше перебратся в отдельную тему - хватит тут на русском оффтопить.
[forum.vcmi.eu/t/russian-thread/357/1)

Can’t compile from trunk(r2002) on ubuntu 10.10 x64.

  CXX    libvcmi_la-BattleAction.lo
  CXX    libvcmi_la-BattleState.lo
BattleState.cpp: In member function ‘CStack* BattleInfo::generateNewStack(const CStackInstance&, int, bool, int, THex) const’:
BattleState.cpp:731: warning: suggest parentheses around ‘&&’ within ‘||’
BattleState.cpp: In member function ‘void BattleInfo::getStackQueue(std::vector<const CStack*, std::allocator<const CStack*> >&, int, int, int) const’:
BattleState.cpp:971: warning: suggest parentheses around ‘&&’ within ‘||’
BattleState.cpp:972: warning: suggest parentheses around ‘&&’ within ‘||’
BattleState.cpp: In member function ‘SpellCasting::ESpellCastProblem BattleInfo::battleCanCastThisSpell(int, const CSpell*, SpellCasting::ECastingMode) const’:
BattleState.cpp:1619: warning: label ‘HERO_CASTING’ defined but not used
BattleState.cpp: In member function ‘SpellCasting::ESpellCastProblem BattleInfo::battleIsImmune(int, const CSpell*, SpellCasting::ECastingMode, THex) const’:
BattleState.cpp:1746: error: no matching function for call to ‘remove_if(std::_List_iterator<Bonus*>, std::_List_iterator<Bonus*>, BattleInfo::battleIsImmune(int, const CSpell*, SpellCasting::ECastingMode, THex) const::NegateRemover)’
make[1]: *** [libvcmi_la-BattleState.lo] Error 1
make[1]: Leaving directory `/home/1/game/0inst/homm3/vcmi/lib'
make: *** [all-recursive] Error 1

Any suggestions?

Sorry. Ccan’t edit guest post and register too: [forum.vcmi.eu/t/new-login-security-measures/354/2)
Correct log:

  CXX    libvcmi_la-BattleAction.lo
  CXX    libvcmi_la-BattleState.lo
BattleState.cpp: In member function 'CStack* BattleInfo::generateNewStack(const CStackInstance&, int, bool, int, THex) const':
BattleState.cpp:731: warning: suggest parentheses around '&&' within '||'
BattleState.cpp: In member function 'void BattleInfo::getStackQueue(std::vector<const CStack*, std::allocator<const CStack*> >&, int, int, int) const':
BattleState.cpp:971: warning: suggest parentheses around '&&' within '||'
BattleState.cpp:972: warning: suggest parentheses around '&&' within '||'
BattleState.cpp: In member function 'SpellCasting::ESpellCastProblem BattleInfo::battleCanCastThisSpell(int, const CSpell*, SpellCasting::ECastingMode) const':
BattleState.cpp:1619: warning: label 'HERO_CASTING' defined but not used
BattleState.cpp: In member function 'SpellCasting::ESpellCastProblem BattleInfo::battleIsImmune(int, const CSpell*, SpellCasting::ECastingMode, THex) const':
BattleState.cpp:1746: error: no matching function for call to 'remove_if(std::_List_iterator<Bonus*>, std::_List_iterator<Bonus*>, BattleInfo::battleIsImmune(int, const CSpell*, SpellCasting::ECastingMode, THex) const::NegateRemover)'
make[1]: *** [libvcmi_la-BattleState.lo] Error 1
make[1]: Leaving directory `/home/1/game/0inst/homm3/vcmi/lib'
make: *** [all-recursive] Error 1

q4a
Got this one too, should be fine now (revision 2008)

Thx. r2015 compiles too, but r2018 not:

CCreatureWindow.cpp: In member function 'void CCreatureWindow::init(const CStackInstance*, const CBonusSystemNode*, const CGHeroInstance*)':
CCreatureWindow.cpp:83: warning: '>>' operator will be treated as two right angle brackets in C++0x
CCreatureWindow.cpp:83: warning: suggest parentheses around '>>' expression
CCreatureWindow.cpp:83: error: 'descriptions' was not declared in this scope
CCreatureWindow.cpp:83: error: '>>' should be '> >' within a nested template argument list
make[1]: *** [vcmiclient-CCreatureWindow.o] Error 1
make[1]: Leaving directory `/home/1/game/vcmi/client'
make: *** [all-recursive] Error

I fixed it by replacing ‘>>’ to ‘> >’.
PS i submited bug: bugs.vcmi.eu/view.php?id=703
and this is my first one. So should i add VCMI_Client_log.txt and VCMI_Server_log.txt every time? or it’s better to add full console output?

PSS Hi Ivan from Russia. Nice to see that VCMI has devs from our country =)

Here is a hierarchy of what’s the most desired for a developer:

  1. (most desired) a map with list of steps needed to reproduce the bug
  2. savegame with list of steps to reproduce the bug
  3. (least desired) VCMI_Client_log.txt, VCMI_Server_log.txt and crashdump (you should use this option only when bug is not reproducible but then remember to back logs up before trying to reproduce it).

In cases 1 and 2 logs can be used just for quick evaluation of possible causes of bugs so you can attach them too but they are not as crucial as in third case. We don’t need console output because everything VCMI prints there is logged too.

Well, that’s not true. There is also output not coming directly from VCMI, like warnings/errors messages printed by libraries directly to stdout and not using our logging system.
The most significant example may be failed assertion — it prints location on the console but doesn’t leave any trace in log file. [It’s annoying, I think about replacing it with my own macro. Or find a convenient way to capture stdout.]

So the console output (in txt or screenshot form) is an element not less important than logfiles. And always it’s good to have as much info as possible, especially if the bug is not easily reproducible.

Otherwise I agree with the list, the best thing is to show us how can we show the issue to ourseleves :slight_smile: