[CMake] Qt4, OpenGL and undefined references...

Bill Hoffman bill.hoffman at kitware.com
Sat Jan 27 15:08:24 EST 2007


Andreas Nicolai wrote:
> /D_/ghorwin/projects/CHAMPS/development/tools/QuickView/QGLMeshPlotWidget/qglmeshplotwidget.obj:qglmeshplotwidget.cpp:(.text+0xe4c): 
> undefined reference to `glMatrixMode at 4'
> CMakeFiles/QuickView.dir/D_/ghorwin/projects/CHAMPS/development/tools/QuickView/QGLMeshPlotWidget/qglmeshplotwidget.obj:qglmeshplotwidget.cpp:(.text+0xe54): 
> undefined reference to `glPushMatrix at 0'
> ...
> and so on
>
>
> Now what am I missing in my cmake project? Could someone maybe post a 
> minimal Qt4 project with OpenGL?
You need to link opengl into your project.
See the FindOpenGL.cmake module.

-Bill



More information about the CMake mailing list