OpenGL error compiling Bullets' demos with MSYS on WinXp

blayde
Posts: 2
Joined: Sat Jan 06, 2007 6:53 am

OpenGL error compiling Bullets' demos with MSYS on WinXp

Post by blayde »

I don't know why I'm getting this error when trying to compile bullet on WinXP, using the MSYS cmake option.
I seem to have the latest version of both MSYS and MinGW.
Just downloaded VS Express to test and that compiles it fine.

'make' ends up as

[ 21%] Building CXX object Demos/OpenGL/CMakeFiles/LibOpenGLSupport.dir/DemoAppl
ication.obj
Linking CXX static library libLibOpenGLSupport.a
[ 21%] Built target LibOpenGLSupport
[ 22%] Building CXX object Demos/CcdPhysicsDemo/CMakeFiles/CcdPhysicsDemo.dir/Cc
dPhysicsDemo.obj
Linking CXX executable CcdPhysicsDemo.exe
c:/Development/bullet-2.42/Demos/OpenGL\libLibOpenGLSupport.a(DemoApplication.ob
j)(.text+0xb28):DemoApplication.cpp: undefined reference to `gluLookAt@72'
c:/Development/bullet-2.42/Demos/OpenGL\libLibOpenGLSupport.a(DemoApplication.ob
j)(.text+0x25ec):DemoApplication.cpp: undefined reference to `gluOrtho2D@32'
c:/Development/bullet-2.42/Demos/OpenGL\libLibOpenGLSupport.a(GL_ShapeDrawer.obj
)(.text+0x4b1):GL_ShapeDrawer.cpp: undefined reference to `gluNewQuadric@0'
c:/Development/bullet-2.42/Demos/OpenGL\libLibOpenGLSupport.a(GL_ShapeDrawer.obj
)(.text+0x677):GL_ShapeDrawer.cpp: undefined reference to `gluQuadricDrawStyle@8
'
c:/Development/bullet-2.42/Demos/OpenGL\libLibOpenGLSupport.a(GL_ShapeDrawer.obj
)(.text+0x68d):GL_ShapeDrawer.cpp: undefined reference to `gluQuadricNormals@8'
c:/Development/bullet-2.42/Demos/OpenGL\libLibOpenGLSupport.a(GL_ShapeDrawer.obj
)(.text+0x6cb):GL_ShapeDrawer.cpp: undefined reference to `gluCylinder@36'
c:/Development/bullet-2.42/Demos/OpenGL\libLibOpenGLSupport.a(GL_ShapeDrawer.obj
)(.text+0x6de):GL_ShapeDrawer.cpp: undefined reference to `gluDeleteQuadric@4'
collect2: ld returned 1 exit status
make[2]: *** [Demos/CcdPhysicsDemo/CcdPhysicsDemo.exe] Error 1
make[1]: *** [Demos/CcdPhysicsDemo/CMakeFiles/CcdPhysicsDemo.dir/all] Error 2
make: *** [all] Error 2
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

This sounds like a CMake configuration issue.
Cmake works fine under MacOSX, generating XCode projectfiles.

Can you verify the CMakeList.txt file for your platform? The GLU library is missing in some way,
Erwin
blayde
Posts: 2
Joined: Sat Jan 06, 2007 6:53 am

Post by blayde »

Don't have a CMakeList.txt file, CMakeLists.txt reads as

Code: Select all

PROJECT(BULLET_PHYSICS)

SUBDIRS(src Demos Extras)
Changed that to below, with no change

Code: Select all

PROJECT(BULLET_PHYSICS)

SUBDIRS(src Demos Extras Glut)
Also looked in CMakeCache.txt. Tried changing

Code: Select all

//Path to a file.
GLUT_INCLUDE_DIR:PATH=GLUT_INCLUDE_DIR-NOTFOUND

//Path to a library.
GLUT_glut_LIBRARY:FILEPATH=GLUT_glut_LIBRARY-NOTFOUND
to below, also no change.

Code: Select all

//Path to a file.
GLUT_INCLUDE_DIR:PATH=C:\Development\bullet-2.42\Glut\GL\glut.h

//Path to a library.
GLUT_glut_LIBRARY:FILEPATH=C:\Development\bullet-2.42\Glut\glut32.lib
Tried these changes individually and together.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Apparently you don't have glut/glu installed properly, or the CMakeList.txt doesn't work fine with your setup.
You should not touch the CMakeCache.txt file, it just gives you information. And it tells you it cannot find glut on your PC.

Did you install glut? perhaps freeglut-devel is a package for you?

Check the CMakeList.txt located in Bullet/Demos/CcdPhysicsDemo. It does a 'find' for GLU:

Code: Select all

# This is the shortcut to finding GLU, GLUT and OpenGL if they are properly installed on your system
# This should be the case.
INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/FindGLUT.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
Otherwise, the CMake forum/mailing list might be able to offer support how to install/use GLUT/GLU/OpenGL for your MSYS and MinGW environment with CMake, see http://www.cmake.org

Note that you don't need the Demos/OpenGL to use Bullet, the collision detection/physics library seem to compile fine for you.

Hope this helps,
Erwin
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Just spotted the typo that causes MinGW32/MSYS to not link properly:

for each demo, edit CMakeList.txt and at the last line, rename

${OPENGL_glU_LIBRARY}
into
${OPENGL_glu_LIBRARY}

This has been committed to SVN, so should go into Bullet 2.51
Hope this fixes the issue for you,
Thanks,
Erwin