MathForGameDevelopers icon indicating copy to clipboard operation
MathForGameDevelopers copied to clipboard

can't compile on linux

Open victorqribeiro opened this issue 9 years ago • 3 comments

Hi, there's a problema when compiling on linux:

g++ -std=c++0x -I. -Icommon -Imath -Iinclude -c game/game.cpp -o game/game.o game/game.cpp: In member function ‘virtual bool CGame::MouseInput(int, tinker_mouse_state_t)’: game/game.cpp:299:10: error: ‘sleep’ was not declared in this scope sleep(1); ^ make: *** [game/game.o] Error 1

victorqribeiro avatar Dec 03 '16 07:12 victorqribeiro

Try #include <unistd.h> at the top

BSVino avatar Dec 03 '16 16:12 BSVino

Now I got this:

/usr/bin/ld: common/platform_linux.o: undefined reference to symbol 'XGetWindowAttributes' //usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make: *** [mfgd] Error 1

victorqribeiro avatar Dec 04 '16 06:12 victorqribeiro

Yea sorry I never maintained the linux port very well. You probably have to include -libX or -libXrandr or something.

BSVino avatar Dec 04 '16 18:12 BSVino