Issue
I followed this and it showed me steps for installing.
I have dependencies previously installed.
unzip Box2D_v2.1.2.zip
cd Box2D_v2.1.2/Box2D/Build
cmake ..
make
At the last step of make I got the following message.
/usr/bin/ld: ../freeglut/libfreeglut_static.a(freeglut_state.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
I searched online everyone said to compile with -X11
flag but this a make file and i dont much abou that
Solution
This error occurs because the CMakeLists.txt
file in Testbed
is not configured for Linux.
To fix this, open the file Box2D_v2.1.2/Box2D/Testbed/CMakeLists.txt
and change the following lines accordingly.
From this:
if(APPLE)
# We are not using the Apple's framework version, but X11's
include_directories( /usr/X11/include )
link_directories( /usr/X11/lib )
set (OPENGL_LIBRARIES GL GLU GLUT X11)
endif(APPLE)
To this:
if(UNIX)
# We are not using the Apple's framework version, but X11's
include_directories( /usr/X11/include )
link_directories( /usr/X11/lib )
set (OPENGL_LIBRARIES GL GLU X11)
endif(UNIX)
This worked for me.
Answered By - John Escobia