Errors in the CMake files for MinGW/Code::Blocks
Posted: Tue Jul 02, 2013 18:35
Hello.
I have ran into some problems with linking CEGUI statically using MinGW and Code::Blocks on Win32. It builds fine dynamically, and sample application works fine, however when trying to compile it statically I run into the following errors:
The "missing" functions all reside in libglew.a - I have checked, the library exists (both libglew.a and libglew_d.a), and in CMakeCache.txt the path to it is correctly specified in CEGUIOpenGLRenderer-0_Static_LIB_DEPENDS. It also seems to be properly linked in build/cegui/src/RendererModules/OpenGL/CMakeFiles/CEGUIOpenGLRenderer-0.dir/link.txt
What am I doing wrong?
I have ran into some problems with linking CEGUI statically using MinGW and Code::Blocks on Win32. It builds fine dynamically, and sample application works fine, however when trying to compile it statically I run into the following errors:
Code: Select all
Linking CXX shared library ..\..\..\..\bin\libCEGUIOpenGLRenderer-0.dll
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x1a): undefined reference to `_imp____glewBindFramebufferEXT'
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x3a): undefined reference to `_imp____glewDeleteFramebuffersEXT'
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x87): undefined reference to `_imp____glewBindFramebufferEXT'
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x110): undefined reference to `_imp____glewBindFramebufferEXT'
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x1bc): undefined reference to `_imp____glewDeleteFramebuffersEXT'
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x229): undefined reference to `_imp____glewGenFramebuffersEXT'
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x253): undefined reference to `_imp____glewBindFramebufferEXT'
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x34a): undefined reference to `_imp____glewFramebufferTexture2DEXT'
CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj):GLFBOTextureTarget.cpp:(.text+0x58b): undefined reference to `_imp____GLEW_EXT_framebuffer_object'
g:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: CMakeFiles\CEGUIOpenGLRenderer-0.dir/objects.a(GLFBOTextureTarget.cpp.obj): bad reloc address 0x1 in section `.text$_ZN5CEGUI23InvalidRequestExceptionD1Ev[__ZN5CEGUI23InvalidRequestExceptionD1Ev]'
collect2.exe: error: ld terminated with code 1
mingw32-make.exe[2]: *** [bin/libCEGUIOpenGLRenderer-0.dll] Error 1
mingw32-make.exe[1]: *** [cegui/src/RendererModules/OpenGL/CMakeFiles/CEGUIOpenGLRenderer-0.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
cegui\src\RendererModules\OpenGL\CMakeFiles\CEGUIOpenGLRenderer-0.dir\build.make:301: recipe for target 'bin/libCEGUIOpenGLRenderer-0.dll' failed
CMakeFiles\Makefile2:184: recipe for target 'cegui/src/RendererModules/OpenGL/CMakeFiles/CEGUIOpenGLRenderer-0.dir/all' failed
Makefile:135: recipe for target 'all' failed
The "missing" functions all reside in libglew.a - I have checked, the library exists (both libglew.a and libglew_d.a), and in CMakeCache.txt the path to it is correctly specified in CEGUIOpenGLRenderer-0_Static_LIB_DEPENDS. It also seems to be properly linked in build/cegui/src/RendererModules/OpenGL/CMakeFiles/CEGUIOpenGLRenderer-0.dir/link.txt
What am I doing wrong?