Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Qt on QNX] Problem compiling a HelloWorld Qt Quick Application

[Qt on QNX] Problem compiling a HelloWorld Qt Quick Application

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 117 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    danhin
    wrote on 13 Feb 2025, 13:31 last edited by danhin
    #1

    I've downloaded trials of QNX SDP 7.1 and Qt 6.7.3 for QNX 7.1 so that I can evaluate them for a new project. The goal is to be able to compile and deploy a basic Hello World application to a virtual machine at first just to make sure that my environment is set up correctly. So far, I've encountered three issues, and two of them have been resolved. First, I enabled toybox and added symbolic links for various required command line commands that Qt needed. Second, I downloaded missing libraries from the QNX Software Center. Now, I'm at what appears to be a CMake compiling issue. I've never used CMake before. So, this is new territory. Below is the output from CMake.

    08:09:38: Running steps for project HelloWorld...
    08:09:38: Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build C:/Users/danhin/development/qt/HelloWorld/build/Qt_6_7_3_for_QNX_7_1_x86_64-Debug --target all install
    [1/10 3.2/sec] Automatic MOC and UIC for target appHelloWorld
    [2/9 5.8/sec] Running AUTOMOC file extraction for target appHelloWorld
    [3/4 2.4/sec] Linking CXX executable appHelloWorld
    FAILED: appHelloWorld 
    C:\Windows\system32\cmd.exe /C "cd . && C:\Users\danhin\qnx710\host\win64\x86_64\usr\bin\q++.exe -Vgcc_ntox86_64 -Wc,-isysroot,C:/Users/danhin/qnx710//target/qnx7 -lang-c++ -DQT_QML_DEBUG -g -g  CMakeFiles/appHelloWorld.dir/appHelloWorld_autogen/mocs_compilation.cpp.o CMakeFiles/appHelloWorld.dir/main.cpp.o CMakeFiles/appHelloWorld.dir/apphelloworld_qmltyperegistrations.cpp.o CMakeFiles/appHelloWorld.dir/build/Qt_6_7_3_for_QNX_7_1_x86_64-Debug/.qt/rcc/qrc_qmake_HelloWorld.cpp.o CMakeFiles/appHelloWorld.dir/build/Qt_6_7_3_for_QNX_7_1_x86_64-Debug/.rcc/qmlcache/appHelloWorld_qmlcache_loader.cpp.o CMakeFiles/appHelloWorld.dir/build/Qt_6_7_3_for_QNX_7_1_x86_64-Debug/.rcc/qmlcache/appHelloWorld_Main_qml.cpp.o CMakeFiles/appHelloWorld.dir/build/Qt_6_7_3_for_QNX_7_1_x86_64-Debug/.qt/rcc/qrc_appHelloWorld_raw_qml_0.cpp.o -o appHelloWorld  -Wl,-rpath,C:/Qt/6.7.3/qnx71_x86_64/lib:  C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6Quick.so.6.7.3  C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6QmlModels.so.6.7.3  C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6Qml.so.6.7.3  C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6QmlBuiltins.a  C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6Network.so.6.7.3  -lsocket  C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6OpenGL.so.6.7.3  C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6Gui.so.6.7.3  C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6Core.so.6.7.3  C:/Users/danhin/qnx710/target/qnx7/x86_64/usr/lib/libGLESv2.so  C:/Users/danhin/qnx710/target/qnx7/x86_64/usr/lib/libEGL.so && cd ."
    C:\Users\danhin\qnx710\\host\win64\x86_64\usr\bin\x86_64-pc-nto-qnx7.1.0-ld: C:/Qt/6.7.3/qnx71_x86_64/lib/libQt6Core.so.6.7.3: undefined reference to `std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >)'
    cc: C:/Users/danhin/qnx710//host/win64/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-ld caught signal 1
    ninja: build stopped: subcommand failed.
    08:09:40: The process "C:\Qt\Tools\CMake_64\bin\cmake.exe" exited with code 1.
    08:09:40: Error while building/deploying project HelloWorld (kit: Qt 6.7.3 for QNX 7.1 x86_64)
    08:09:40: When executing step "Build"
    08:09:40: Elapsed time: 00:06.
    
    

    Upon further research, I found that std::condition_variable::do_timed_wait() is part of the C++ standard library. So, I set the CMAKE_CXXX_STANDARD variable to 17 as shown in CMakeLists below

    cmake_minimum_required(VERSION 3.16)
    
    project(HelloWorld VERSION 0.1 LANGUAGES CXX)
    
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    find_package(Qt6 REQUIRED COMPONENTS Quick)
    
    qt_standard_project_setup(REQUIRES 6.5)
    
    qt_add_executable(appHelloWorld
        main.cpp
    )
    
    qt_add_qml_module(appHelloWorld
        URI HelloWorld
        VERSION 1.0
        QML_FILES
            Main.qml
    )
    
    # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
    # If you are developing for iOS or macOS you should consider setting an
    # explicit, fixed bundle identifier manually though.
    set_target_properties(appHelloWorld PROPERTIES
    #    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appHelloWorld
        MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
        MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
        MACOSX_BUNDLE TRUE
        WIN32_EXECUTABLE TRUE
    )
    
    target_link_libraries(appHelloWorld
        PRIVATE Qt6::Quick
    )
    
    include(GNUInstallDirs)
    install(TARGETS appHelloWorld
        BUNDLE DESTINATION .
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
    

    That was the only change that I made to this project after creating it and it didn't resolve the issue. Thanks in advance for the assistance.

    1 Reply Last reply
    0

    1/1

    13 Feb 2025, 13:31

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved