Qt 6.7.2 can't find OpenGL::GL
Unsolved
Installation and Deployment
-
Hello! I'm trying to upgrade my Qt version from 6.2.2 to 6.7.2 - I have built everything, I need and compiled but when I try to run
cmake ..
on my project, I get this error. It's exactly the same code base as it worked on 6.2.2. I'm running on Nvidia Jetson TX2 on Jetpack 4.6.2 (Ubuntu 18.04) - and no, it's not possible to upgrade. I only need to run Qt in EGLFS mode and it was supported when I configured 6.7.2 compilation.This is the CMake output:
CMake Error at /opt/Qt/6.7.2/lib/cmake/Qt6/FindWrapOpenGL.cmake:51 (target_link_libraries): The link interface of target "WrapOpenGL::WrapOpenGL" contains: OpenGL::GL but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. Call Stack (most recent call first): /usr/share/cmake-3.23/Modules/CMakeFindDependencyMacro.cmake:47 (find_package) /opt/Qt/6.7.2/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency) /opt/Qt/6.7.2/lib/cmake/Qt6Gui/Qt6GuiDependencies.cmake:33 (_qt_internal_find_third_party_dependencies) /opt/Qt/6.7.2/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake:43 (include) /opt/Qt/6.7.2/lib/cmake/Qt6/Qt6Config.cmake:169 (find_package) CMakeLists.txt:107 (find_package)
What has changed since Qt 6.2 and Qt 6.7? This is the output of my Qt 6.7 configuration:
Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. yes Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ yes Text formats: HtmlParser ........................... yes CssParser ............................ yes OdfWriter ............................ yes MarkdownReader ....................... yes Using system libmd4c ............... no MarkdownWriter ....................... yes EGL .................................... yes OpenVG ................................. no OpenGL: Desktop OpenGL ....................... yes OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes
-
I tried to create a minimal CMake project, which uses OpenGL - it does find it well.
This is the output:
"-- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Warning (dev) at /usr/share/cmake-3.23/Modules/FindOpenGL.cmake:315 (message): Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when available. Run "cmake --help-policy CMP0072" for policy details. Use the cmake_policy command to set the policy and suppress this warning. FindOpenGL found both a legacy GL library: OPENGL_gl_LIBRARY: /usr/lib/aarch64-linux-gnu/libGL.so and GLVND libraries for OpenGL and GLX: OPENGL_opengl_LIBRARY: /usr/lib/aarch64-linux-gnu/libOpenGL.so OPENGL_glx_LIBRARY: /usr/lib/aarch64-linux-gnu/libGLX.so OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for compatibility with CMake 3.10 and below the legacy GL library will be used. Call Stack (most recent call first): CMakeLists.txt:14 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. -- Found OpenGL: /usr/lib/aarch64-linux-gnu/libOpenGL.so -- Configuring done -- Generating done"
I also tried adding
set(OpenGL_GL_PREFERENCE GLVND)
andset(OpenGL_GL_PREFERENCE LEGACY)