[Solved] CMake error Qt5Gui extra libraries



  • I am trying to build with CMake a QT5 application that uses Core, Gui, OpenGL and Widgets modules. CMake finds Qt5Core_DIR, QT5Gui_DIR and Qt5Widgets_DIR, but when trying to find Qt5Gui_glu32_LIBRARY, Qt5Gui_opengl32_LIBRARY it outputs this error:

    @CMake Error at C:/qt_src/qt5-2010/qtbase/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:13 (message):
    Failed to find "glu32" in "", using the CMAKE_FIND_ROOT_PATH "".
    Call Stack (most recent call first):
    C:/qt_src/qt5-2010/qtbase/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:38 (_qt5gui_find_extra_libs)
    C:/qt_src/qt5-2010/qtbase/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:100 (include)
    C:/qt_src/qt5-2010/qtbase/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:56 (find_package)
    CMakeLists.txt:23 (FIND_PACKAGE)@

    If I create a QTOpenGL app with the visual studio add-in I encounter no problems.

    My CMakeLists.txt is this:

    @cmake_minimum_required(VERSION 2.8.8)
    project(tovias)
    #################################################

    Default settings

    IF (NOT CMAKE_BUILD_TYPE)
    SET(CMAKE_BUILD_TYPE Release)
    ENDIF (NOT CMAKE_BUILD_TYPE)

    #OPTION(OSG_DIR "" ON)

    #OpenGL
    find_package(OpenGL REQUIRED)
    include_directories(${OPENGL_INCLUDE_DIRS})

    #QT 5
    #set(QT_USE_QTOPENGL TRUE)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set (CMAKE_PREFIX_PATH ${QTDIR})
    #FIND_PACKAGE(Qt5Core REQUIRED)
    FIND_PACKAGE(Qt5Widgets REQUIRED)

    SET(SOURCE
    main.cpp
    mainwindow.cpp
    glrenderthread.cpp
    glframe.cpp
    )

    SET(HEADERS
    mainwindow.h
    glrenderthread.h
    glframe.h
    )

    SET(FORMS
    mainwindow.ui
    )

    qt5_wrap_ui(FORMS_HEADERS ${FORMS})
    add_executable(toview ${SOURCE} ${HEADERS} ${FORMS_HEADERS})
    qt5_use_modules(toview Core Gui OpenGL Widgets)@

    Anyone knows what am I missing? I have been all day trying to figure this out with no luck...

    EDIT: Forgot to mention I'm using Windows 7 x64.



  • I just fixed the error. Just in case anybody else has this problem, this is how I fixed it:

    Create a new environment variable with the path to the WindowsSDK libraries and add it to prefix.

    @set (CMAKE_PREFIX_PATH "${QTDIR}; ${WINSDK_LIB}")@



  • This seems not solved for me. I'm trying to switch to Qt 5.1.0 for all my projects on Windows 8 x64, MSVC11 (Qt 5.1.0 for Windows 64-bit (VS 2012, OpenGL, 522 MB) . For most of my projects i use CMake, OpenGL, and QT.

    With Qt 5.0.2 i had no issue with mingw x86 and x64, msvc10 x64 and x86 and msvc11 x64. No issues concerning CMake in any projects.

    With the new Qt5.1.0 i get the above error
    CMake Error at C:/Qt/5.1.0/qtbase/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message):
    Failed to find "glu32" in ""."

    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 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)?

    Can someone please provide any help? If one needs CMakeLists, i could provide, but i think that is not a cmake issue. I'm using CMake 2.8.11.2 and 2.8.10, both versions work with Qt.5.0.2. I think the error might be in the mentioned Qt5GuiConfigExtras.cmake files. I'll try to investiage there.



  • tested it on linux (ubuntu 12.04) too - no errors here with 5.1.0 x64





  • I'm still having trouble with this! I'm stuck someone please help me! I've applied the suggested fix located here. But that doesn't seem to help.

    Here's my question:
    http://www.qtcentre.org/threads/56185-cmake-error-with-Failed-to-find-quot-glu32-quot-in-quot-quot?p=251234#post251234



  • Why this error happens at all?
    How I can fix this without specifying this cmake option in all my projects?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.