Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-37268

QtGui doesn't include its dependency to its OpenGL backend (angle or desktop-opengl) when using CMake

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.2.1
    • Build System, GUI: OpenGL
    • None

      I am trying to take the Qt example from the Qt-distribution in examples/gui/openglwindow/ and make it compile/run with CMake on Windows. However, when compiling, it fails with a bunch of “error LNK2019: unresolved external symbol __imp_glClear” and some more.

      To reproduce:
      CMakeLists.txt:

      PROJECT( oglwin )
      CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 )
      cmake_policy(SET CMP0020 NEW) # for Qt: auto-link to qtmain.lib

      set(CMAKE_AUTOMOC ON)
      find_package(Qt5Core REQUIRED)
      find_package(Qt5Gui REQUIRED)

      SET(SOURCE
      main.cpp
      openglwindow.cpp
      )
      SET(HEADERS
      openglwindow.h
      )
      ADD_EXECUTABLE( oglwin ${SOURCE} ${HEADERS} )
      TARGET_LINK_LIBRARIES( oglwin Qt5::Core Qt5::Gui )

      Will produce above-mentioned linker errors and not link to libGLESv2.lib. My installed Qt is of course compiled with the ANGLE backend.

      https://bugreports.qt-project.org/browse/QTBUG-29132 might describe a similar problem and says it's fixed, but it might not be.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            steveire Stephen Kelly (Personal)
            patrik Patrik Huber
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes