-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.2.1
-
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.