Qt for QNX Support Qt for QNX Runtime Target Requirements
Building Qt 6 requires downloading and installing of QNX SDP 7.1 from the QNX website.
Note: A suitable license is required. Contact QNX for more information.
The compiler and other parts of the tool chain are provided in the SDP packages. Initialize your build environment by running the QNX setup script from your SDP installation folder in a terminal, like so:
source qnxsdp-env.sh
The cross-compiling Qt requires a host build of Qt being available. During the build, tools such as moc
, rcc
, qmlcachegen
, qsb
, are invoked from there. You can either
build Qt from sources for the host or install host build using online installer. However, it is advisable to ensure that you can build Qt for the desktop target on the
host as well. For more detailed information please see Cross-compiling Qt.
To cross-compile a project with CMake a toolchain file is needed. This CMake-language file sets the right values for the platform name, compiler/linker, and many other toolchain-specific things. A minimal toolchain file can be found from CMake documentation:
set(CMAKE_SYSTEM_NAME QNX) set(arch gcc_ntoarmv7le) set(CMAKE_C_COMPILER qcc) set(CMAKE_C_COMPILER_TARGET ${arch}) set(CMAKE_CXX_COMPILER q++) set(CMAKE_CXX_COMPILER_TARGET ${arch}) set(CMAKE_SYSROOT $ENV{QNX_TARGET})
The arch
variable can be set to either gcc_ntoarmv7le
, gcc_ntoaarch64le
or gcc_ntox86_64
, depending on your target architecture.
Assuming the following:
$HOME
.$HOME/qt
.$HOME/qt-host
.$HOME/qnx-install
.After creating and switching to the build
directory run:
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=$HOME/qnx.cmake \ -DQT_HOST_PATH=$HOME/qt_host \ -DCMAKE_INSTALL_PREFIX=$HOME/qnx_install \ $HOME/qt
Once configuration completes without errors,build by running:
cmake --build . --parallel
Once built, run:
cmake --install .
Which will install the results to $HOME/qnx_install
.
You can also configure Qt with the configure tool. Since Qt 6, this tool is a wrapper around CMake.
Make sure that your system image contains the following additional 3rd-party libraries which are not always included in minimal QNX Neutrino RTOS images:
libfontconfig
libfreetype
libiconv
libicui18n
libicudata
libicuuc
libpng14
libxml2
libsqlite3
libssl
libcrypto
Note: This is not a complete list of shared libraries used by Qt on QNX Neutrino OS. Multiple shared libraries are already available in a typical OS image, or included by other parts of the system, for example
Screen
.
See also Qt Configure Options and Configuring Qt.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: