build Bullet on OSX 10.9

mzu
Posts: 1
Joined: Mon Sep 08, 2014 7:47 pm

build Bullet on OSX 10.9

Post by mzu »

Hi,

I'm completely new to Bullet and already have a question building the libs. Hopefully someone can help. I'm trying to build Bullet on OSX 10.9 using cmake. In the cmake gui I set the cxx flags to -stdlib=libc++ -std=c++11 and I select shared lib as I prefer shared libs. Build type is set to Release. The only other option I set is use double precision. When I run make I keep getting this error:

Linking CXX shared library libgwen.dylib
Undefined symbols for architecture x86_64:
"_glAlphaFunc", referenced from:
Gwen::Renderer::OpenGL_DebugFont::Begin() in OpenGL_DebugFont.o
"_glBindTexture", referenced from:
Gwen::Renderer::OpenGL_DebugFont::OpenGL_DebugFont() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::DrawTexturedRect(Gwen::Texture*, Gwen::Rect, float, float, float, float) in OpenGL_DebugFont.o
"_glBlendFunc", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::Begin() in OpenGL_DebugFont.o
"_glColor4ubv", referenced from:
Gwen::Renderer::OpenGL_DebugFont::SetDrawColor(Gwen::Color) in OpenGL_DebugFont.o
"_glColorPointer", referenced from:
Gwen::Renderer::OpenGL_DebugFont::End() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::Flush() in OpenGL_DebugFont.o
"_glDisable", referenced from:
restoreOpenGLState() in OpenGL_DebugFont.o
saveOpenGLState(int, int) in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::DrawFilledRect(Gwen::Rect) in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::EndClip() in OpenGL_DebugFont.o
"_glDrawArrays", referenced from:
Gwen::Renderer::OpenGL_DebugFont::End() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::Flush() in OpenGL_DebugFont.o
"_glEnable", referenced from:
restoreOpenGLState() in OpenGL_DebugFont.o
saveOpenGLState(int, int) in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::Begin() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::StartClip() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::DrawTexturedRect(Gwen::Texture*, Gwen::Rect, float, float, float, float) in OpenGL_DebugFont.o
"_glEnableClientState", referenced from:
Gwen::Renderer::OpenGL_DebugFont::End() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::Flush() in OpenGL_DebugFont.o
"_glFlush", referenced from:
Gwen::Renderer::OpenGL_DebugFont::End() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::Flush() in OpenGL_DebugFont.o
"_glGenTextures", referenced from:
Gwen::Renderer::OpenGL_DebugFont::OpenGL_DebugFont() in OpenGL_DebugFont.o
"_glGetBooleanv", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::DrawFilledRect(Gwen::Rect) in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::DrawTexturedRect(Gwen::Texture*, Gwen::Rect, float, float, float, float) in OpenGL_DebugFont.o
"_glGetFloatv", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glGetIntegerv", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::StartClip() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::DrawTexturedRect(Gwen::Texture*, Gwen::Rect, float, float, float, float) in OpenGL_DebugFont.o
"_glGetTexEnviv", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glLineWidth", referenced from:
restoreOpenGLState() in OpenGL_DebugFont.o
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glLoadIdentity", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glMatrixMode", referenced from:
restoreOpenGLState() in OpenGL_DebugFont.o
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glOrtho", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glPopAttrib", referenced from:
restoreOpenGLState() in OpenGL_DebugFont.o
"_glPopClientAttrib", referenced from:
restoreOpenGLState() in OpenGL_DebugFont.o
"_glPopMatrix", referenced from:
restoreOpenGLState() in OpenGL_DebugFont.o
"_glPushAttrib", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glPushClientAttrib", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glPushMatrix", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glScissor", referenced from:
Gwen::Renderer::OpenGL_DebugFont::StartClip() in OpenGL_DebugFont.o
"_glTexCoordPointer", referenced from:
Gwen::Renderer::OpenGL_DebugFont::End() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::Flush() in OpenGL_DebugFont.o
"_glTexEnvi", referenced from:
restoreOpenGLState() in OpenGL_DebugFont.o
saveOpenGLState(int, int) in OpenGL_DebugFont.o
"_glTexImage2D", referenced from:
Gwen::Renderer::OpenGL_DebugFont::OpenGL_DebugFont() in OpenGL_DebugFont.o
"_glTexParameteri", referenced from:
Gwen::Renderer::OpenGL_DebugFont::OpenGL_DebugFont() in OpenGL_DebugFont.o
"_glVertexPointer", referenced from:
Gwen::Renderer::OpenGL_DebugFont::End() in OpenGL_DebugFont.o
Gwen::Renderer::OpenGL_DebugFont::Flush() in OpenGL_DebugFont.o
"_glViewport", referenced from:
saveOpenGLState(int, int) in OpenGL_DebugFont.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [btgui/Gwen/libgwen.dylib] Error 1
make[1]: *** [btgui/Gwen/CMakeFiles/gwen.dir/all] Error 2
make: *** [all] Error 2

Can anybody help me out with this please ? I'd really appreciate the help.
I didn't set the architecture in this case. I have tried it before setting it to x86_64 with the same result.

Thanks a lot for any input.

Kind regards,
Michael
LEgregius
Posts: 26
Joined: Tue Oct 14, 2008 1:34 am

Re: build Bullet on OSX 10.9

Post by LEgregius »

I'm building on 2.79, 2.81, 2.82, and the 2.83/3.0 alpha on OS X 10.9 both 32bit and 64bit. I'm not seeing that error, though I do get some compile errors in the demos when building with doubles on the 2.83/3.0 alpha.

I use the following bash script.

Code: Select all

rm -rf bulletBuild
rm -rf installPath
mkdir bulletBuild
cd bulletBuild

OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk

if cmake -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 -DCMAKE_OSX_SYSROOT=$OSX_SYSROOT -DCMAKE_INSTALL_PREFIX=$PWD/../installPath -DCMAKE_BUILD_TYPE=Release -DUSE_DOUBLE_PRECISION=ON ..; then
   make -j8 && make install
fi