[Solved] Qt 5.1 OpenGL with CMake - Failed to find "glu32" in "".
-
I tried to "port" my projects from 5.0.2 (-opengl desktop) to 5.1.0 to either -opengl desktop or precompiled (x64 VS2012 OpenGL installer) from download. System Environments: x64 on Windows 8 with Visual Studio 2012, and on linux. The projects require QtGui, QtOpenGL, QtWidgets and QtCore for now and are set up with CMake.
With Qt 5.0.2 i had no issue with mingw x86 and x64, msvc10 ×64 and x86 and msvc11 ×64. No issues concerning CMake in any projects.
With 5.1.0 on Win8 x64 i get the error (linux works fine):
@CMake Error at C:/Qt/5.1.0/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message):
Failed to find "glu32" in "".
Call Stack (most recent call first):
C:/Qt/5.1.0/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:50 (_qt5gui_find_extra_libs)
C:/Qt/5.1.0/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:127 (include)
CMakeLists.txt:21 (find_package)@I strictly need desktop OpenGL since i work with OpenGL 3.2 and up.
Building the qt libs myself worked fine as always, but resulted in the same CMake error.The windowsSDK (as suggested in http://qt-project.org/forums/viewthread/29014) should have nothing to do with that, since it was never required on earlier Qt versions (5.0.2). Further more, i have it on one of my machines and the solution/fix suggested does not work for me. Why should it (please provide more information if it does)?
Some of the projects also require the OpenGL libs (opengl32 and glu32), that are correctly found. Either with or without this, the error occurs.
@find_package(OpenGL REQUIRED)
...
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
...@I think that is not an issue with the projects' cmake configurations. I’m using CMake 2.8.11.2 and 2.8.10, both versions work with Qt.5.0.2. I think the issue might be in the mentioned Qt5Gui_.cmake files.
Full CMake log:
@The C compiler identification is MSVC 17.0.60315.1
The CXX compiler identification is MSVC 17.0.60315.1
Check for working C compiler using: Visual Studio 11 Win64
Check for working C compiler using: Visual Studio 11 Win64 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 11 Win64
Check for working CXX compiler using: Visual Studio 11 Win64 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
CMake Error at C:/Qt/5.1.0/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message):
Failed to find "glu32" in "".
Call Stack (most recent call first):
C:/Qt/5.1.0/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:50 (_qt5gui_find_extra_libs)
C:/Qt/5.1.0/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:127 (include)
CMakeLists.txt:21 (find_package)@CMake excerpt:
@
Define project
cmake_minimum_required(VERSION 2.6)
project(moep)set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Limited Configs" FORCE)
set(CMAKE_AUTOMOC ON)
set(AUTOMOC_MOC_OPTIONS PROPERTIES FOLDER CMakeAutomocTargets)find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)set(sources src/main.cpp ...)
add_executable(${target} ${sources})
include_directories(${CMAKE_SOURCE_DIR})qt5_use_modules(${target} OpenGL Gui Widgets)@
Can someone please provide any help?
-
ps And your link
@The windowsSDK (as suggested in http://qt-project.org/forums/viewthread/29014)@doesnt seem to work for me... was that thread closed?
-
it seems that WindowsSDK is indeed needed to provide Qt with OpenGL bindings: http://www.opengl.org/discussion_boards/showthread.php/176620-Need-help-missing-opengl32-lib-glu32-lib .
Qt 5.1 support of OpenGL changed rather significantly, since it provides OpenGL3+ profiles, which it didnt do before. Not surprising that requirements changed. -
So it worked for me(at least the CMake coniguration, didnt try to actually use it in compilation yet).
Steps to reproduce:- I used precompiled version of Qt 5.1(the one with OpenGL x64 for VS2012). To use it should be fine for you, as Qt 5.1 should support OpenGL3.2+ profiles out of the box, i dont think you need to use Glew anymore, just look at http://qt-project.org/doc/qt-5.1/qtgui/qabstractopenglfunctions.html hierarchy
- Installed Win SDK 8.0. But i think 7.0 could be fine.
- added
set (CMAKE_PREFIX_PATH "C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64")
line to my cmake file.
That's where glu32.lib and similar files are located. - Run cmake-gui configure&generate, using VS 11 win64 as generator.
-
Hallo,
I've just encountered the same problem. Just a quick question:
In which cmake-file did you make the change ( .. set (CMAKE_PREFIX_PATH ..)) ?
Sorry, I'm pretty new to this.
Thanks!Chris
-
I've run into this problem, and the suggested fix doesn't work for me. I've tried everything I can. Can someone iteratively work through this with me sometime soon? It should take someone that knows what is wrong about 10 minutes. I'm not an idiot, I'm just in a rush and I want to know how to solve this.
Here's my more detailed question:
http://www.qtcentre.org/threads/56185-cmake-error-with-Failed-to-find-quot-glu32-quot-in-quot-quot?p=251234#post251234Here's another question that I've responded to trying to raise awareness:
http://qt-project.org/forums/viewthread/32267/ -
Solved:
set (CMAKE_MODULE_PATH “C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64”) -
same issue none of the solutions work.
C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64/Gdi32.Lib
C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64/GlU32.Lib
C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64/OpenGL32.Libthose are the files I point to. but after presssing configure it comlains again about glu32 not found, when do that then it complains about Opnegl32 not found and it goes in circle :((((((((((((( WTF ????????????????