如何解决Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE ""

使用 CMake 编译依赖于 opengl 版本的 Qt 库时,会出现错误:

CMake Error at C:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message):
Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE "".


本文为博主原创,转载请注明,本文地址 http://blog.csdn.net/houston11235/article/details/32169117


是由于 Cmake 没有找到 glu32.lib 这个文件,这个文件是使用 Qt 编译所依赖的。解决方法也很简单,在上面标红的 Cmake 文件的开头添加如下语句 (add sentences below to the top of the .cmake file that error occur)


windows 7:

set(CMAKE_LIBRARY_PATH "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Lib") 


windows 8:

set(CMAKE_LIBRARY_PATH "C:\\Program Files (x86)\\Windows Kits\\8.0\\Lib\\win8\\um\\x64") 


然后再 configure cmake 就行了,注意路径时双反斜杠


参考链接:

1、http://www.cnblogs.com/luckystar-67/p/3663745.html

2、https://bugreports.qt-project.org/browse/QTBUG-34940

猜你喜欢

转载自blog.csdn.net/goobird/article/details/42427991