Difficulty with Qt 6.5.0 cross compile for QNX, OpenGL libraries
Unsolved
Mobile and Embedded
-
Hi Everyone,
I am attempting to cross compile Qt 6.5.0 for qnx 7.1.0. I am following the following guide:
https://doc.qt.io/qt-6/building-qt-for-qnx.htmlmy cross compile command is as follows:
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/home/matt/qnx.cmake -DQT_HOST_PATH=~/qt6Host -DCMAKE_INSTALL_PREFIX=~/qnx_install ~/qtbase
with qtbase contain the 6.5.0 branch of the repo
I am getting the following output from this command:
-- The CXX compiler identification is GNU 8.3.0 -- The C compiler identification is GNU 8.3.0 -- The ASM compiler identification is GNU -- Found assembler: /home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-gcc -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -DCMAKE_C_FLAGS_DEBUG=-g -DCMAKE_C_FLAGS_RELEASE=-O3 -DNDEBUG -DCMAKE_C_FLAGS_RELWITHDEBINFO=-O2 -g -DNDEBUG -DCMAKE_CXX_FLAGS_DEBUG=-g -DCMAKE_CXX_FLAGS_RELEASE=-O3 -DNDEBUG -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O2 -g -DNDEBUG -DCMAKE_OBJCOPY=/home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-objcopy -DCMAKE_TOOLCHAIN_FILE=/home/matt/qnx.cmake -DCMAKE_C_STANDARD=11 -DCMAKE_C_STANDARD_REQUIRED=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_MODULE_PATH:STRING=/home/matt/qtbase/cmake/platforms -- Configuration summary shown below. It has also been written to /home/matt/qt-cross/config.summary -- Configure with --log-level=STATUS or higher to increase CMake's message verbosity. The log level does not persist across reconfigurations. -- Configure summary: Building for: qnx-x86-64-qcc (x86_64, CPU features: mmx sse sse2) Compiler: gcc 8.3.0 Build options: Mode ................................... release Optimize release build for size ........ no Fully optimize release builds (-O3) .... no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++17 Using ccache ........................... no Relocatable ............................ yes Using precompiled headers .............. yes Using Link Time Optimization (LTCG) .... no Using Intel CET ........................ no Target compiler supports: x86 Intrinsics ....................... Basic VAES Sanitizers: Addresses ............................ no Threads .............................. no Memory ............................... no Fuzzer (instrumentation only) ........ no Undefined ............................ no Build parts ............................ libs Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... no Qt Gui ................................. yes Qt Network ............................. yes Qt PrintSupport ........................ yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... no udev ................................... no OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ yes OpenSSL 3.0 ............................ no Using system zlib ...................... no Zstandard support ...................... no Thread support ......................... yes Common build options: Linker can resolve circular dependencies yes Qt Core: backtrace .............................. no DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no ICU .................................... no Using system libb2 ..................... no Built-in copy of the MIME database ..... yes cpp/winrt base ......................... no Tracing backend ........................ <none> Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no PPS .................................... no PCRE2 .................................. yes Using system PCRE2 ................... no Application permissions ................ no Qt Sql: SQL item models ........................ yes Qt Network: getifaddrs() ........................... no IPv6 ifname ............................ no libproxy ............................... no DTLS ................................... yes OCSP-stapling .......................... yes SCTP ................................... no Use system proxies ..................... yes GSSAPI ................................. no Brotli Decompression Support ........... no qIsEffectiveTLD() ...................... yes Built-in publicsuffix database ....... yes System publicsuffix database ......... no Core tools: Android deployment tool ................ no macOS deployment tool .................. no Windows deployment tool ................ no qmake .................................. yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ no HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... no PNG .................................. yes Using system libpng ................ no Text formats: HtmlParser ........................... yes CssParser ............................ yes OdfWriter ............................ yes MarkdownReader ....................... yes Using system libmd4c ............... no MarkdownWriter ....................... yes EGL .................................... no OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. yes Session Management ..................... yes Features used by QPA backends: evdev .................................. no libinput ............................... no HiRes wheel support in libinput ........ no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. no X11 specific: XLib ................................. no XCB Xlib ............................. no EGL on X11 ........................... no xkbcommon-x11 ........................ no xcb-sm ............................... no QPA backends: DirectFB ............................... no EGLFS .................................. no EGLFS details: EGLFS OpenWFD ........................ no EGLFS i.Mx6 .......................... no EGLFS i.Mx6 Wayland .................. no EGLFS RCAR ........................... no EGLFS EGLDevice ...................... no EGLFS GBM ............................ no EGLFS VSP2 ........................... no EGLFS Mali ........................... no EGLFS Raspberry Pi ................... no EGLFS X11 ............................ no LinuxFB ................................ no VNC .................................... yes VK_KHR_display ......................... yes QNX: lgmon ................................ no IMF .................................. no XCB: Using system-provided xcb-xinput ..... no GL integrations: GLX Plugin ......................... no XCB GLX .......................... no EGL-X11 Plugin ..................... no Windows: Direct 2D ............................ no Direct 2D 1.1 ........................ no DirectWrite .......................... no DirectWrite 3 ........................ no Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt Testlib: Tester for item models ................. yes Batch tests ............................ no Qt PrintSupport: CUPS ................................... no Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. no SQLite ................................. yes Using system provided SQLite ......... no ERROR: The OpenGL functionality tests failed! You might need to modify the OpenGL package search path by setting the OpenGL_DIR CMake variable to the OpenGL library's installation directory. CMake Error at cmake/QtBuildInformation.cmake:194 (message): Check the configuration messages for an error that has occurred. Call Stack (most recent call first): cmake/QtBuildInformation.cmake:24 (qt_configure_print_summary) cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:514 (qt_print_feature_summary) CMakeLists.txt:196 (qt_build_repo_end) -- Configuring incomplete, errors occurred!
The CMakeConfigureLog.yaml shows errors when trying to find gles2 and egl libraries in the sysroot, but I have verified they are present
kind: "try_compile-v1" backtrace: - "/usr/local/share/cmake-3.28/Modules/Internal/CheckSourceCompiles.cmake:101 (try_compile)" - "/usr/local/share/cmake-3.28/Modules/CheckCXXSourceCompiles.cmake:52 (cmake_check_source_compiles)" - "cmake/FindGLESv2.cmake:27 (check_cxx_source_compiles)" - "cmake/QtFindPackageHelpers.cmake:144 (find_package)" - "src/gui/configure.cmake:58 (qt_find_package)" - "cmake/QtFeature.cmake:592 (include)" - "src/CMakeLists.txt:13 (qt_feature_evaluate_features)" directories: source: "/home/matt/qt-cross/CMakeFiles/CMakeScratch/TryCompile-0kGWFu" binary: "/home/matt/qt-cross/CMakeFiles/CMakeScratch/TryCompile-0kGWFu" cmakeVariables: CMAKE_CXX_COMPILER_TARGET: "gcc_ntox86_64" CMAKE_CXX_FLAGS: "" CMAKE_CXX_FLAGS_DEBUG: "-g" CMAKE_CXX_LINK_NO_PIE_SUPPORTED: "1" CMAKE_C_COMPILER_TARGET: "gcc_ntox86_64" CMAKE_C_LINK_NO_PIE_SUPPORTED: "1" CMAKE_EXE_LINKER_FLAGS: " /home/matt/qnx710-toolset/target/qnx7/x86_64/usr/lib/libEGL.so /home/matt/qnx710-toolset/target/qnx7/x86_64/usr/lib/libEGL.so" CMAKE_MODULE_PATH: "/home/matt/qtbase/cmake;/home/matt/qtbase/cmake/3rdparty/extra-cmake-modules/find-modules;/home/matt/qtbase/cmake/3rdparty/kwin;/home/matt/qtbase/cmake/platforms" CMAKE_POSITION_INDEPENDENT_CODE: "ON" CMAKE_SYSROOT: "/home/matt/qnx710-toolset/target/qnx7" buildResult: variable: "HAVE_GLESv2" cached: true stdout: | Change Dir: '/home/matt/qt-cross/CMakeFiles/CMakeScratch/TryCompile-0kGWFu' Run Build Command(s): /usr/bin/ninja -v cmTC_b294b [1/2] /home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-g++ --sysroot=/home/matt/qnx710-toolset/target/qnx7 -DHAVE_GLESv2 -std=gnu++17 -fPIE -o CMakeFiles/cmTC_b294b.dir/src.cxx.o -c /home/matt/qt-cross/CMakeFiles/CMakeScratch/TryCompile-0kGWFu/src.cxx [2/2] : && /home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-g++ --sysroot=/home/matt/qnx710-toolset/target/qnx7 /home/matt/qnx710-toolset/target/qnx7/x86_64/usr/lib/libEGL.so /home/matt/qnx710-toolset/target/qnx7/x86_64/usr/lib/libEGL.so CMakeFiles/cmTC_b294b.dir/src.cxx.o -o cmTC_b294b && : FAILED: cmTC_b294b : && /home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-g++ --sysroot=/home/matt/qnx710-toolset/target/qnx7 /home/matt/qnx710-toolset/target/qnx7/x86_64/usr/lib/libEGL.so /home/matt/qnx710-toolset/target/qnx7/x86_64/usr/lib/libEGL.so CMakeFiles/cmTC_b294b.dir/src.cxx.o -o cmTC_b294b && : /home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-ld: CMakeFiles/cmTC_b294b.dir/src.cxx.o: in function `main': src.cxx:(.text+0x1d): undefined reference to `glUniform1f' /home/matt/qnx710-toolset/host/linux/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-ld: src.cxx:(.text+0x27): undefined reference to `glClear' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. exitCode: 1
My toolchain file, qnx.cmake is currently:
set(CMAKE_SYSTEM_NAME QNX) set(arch gcc_ntox86_64) set(CMAKE_C_COMPILER x86_64-pc-nto-qnx7.1.0-gcc) set(CMAKE_C_COMPILER_TARGET ${arch}) set(CMAKE_CXX_COMPILER x86_64-pc-nto-qnx7.1.0-g++) set(CMAKE_CXX_COMPILER_TARGET ${arch}) set(OPENGL_LIB_PATH "/home/matt/qnx710-toolset/target/qnx7/x86_64/usr/lib/") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link=${OPENGL_LIB_PATH}") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath-link=${OPENGL_LIB_PATH}") set(CMAKE_SYSROOT $ENV{QNX_TARGET})
I am not sure how I should be changing my qnx.cmake file to ensure these are found, or if there is somewhere else I should look. I am rather lost at the moment so any suggestions would be welcome.
Thanks!