I'm trying to compile a software that uses QtOpenGL, but I got a link error because -lGLU is not present.
cmake is used.
The only relevant line in CMakeLists.txt files seems to me find_package(Qt4 REQUIRED)
The system is Linux 64bit, Debian unstable, qt version 4.7.3, cmake version 2.8
I don't know if this is the right solution, but the build completes after I added these lines to
CMakeLists.txt
:and added
to
GLU is neither part of OpenGL nor Qt. You must add it as an additional dependency manually; the CMake FindOpenGL module also searches for GLU
If you do
set(QT_USE_QTOPENGL TRUE)
then-lGLU
is included in the linker options:I solved it this way: