QNX
QNX is a Unix-like real-time operating system for embedded systems, such as digital cockpits, medical devices, and robots. In CLion, you can build QNX applications, run them on a QNX target, and debug them there over SSH, including across shared library boundaries. When you point CLion to your QNX SDP, code completion and navigation also cover the QNX Neutrino APIs.
The integration works only for Makefile projects.
Enable the QNX OS for CLion plugin
This functionality relies on the QNX OS for CLion plugin, which is bundled and enabled in CLion by default. If the relevant features are not available, make sure that you did not disable the plugin.
Press Ctrl+Alt+S to open settings and then select .
Find the QNX OS for CLion plugin and click Enable.
This article uses a sample project and a QNX image running in QEMU on an Ubuntu host. For other Linux distributions, use the equivalent commands of your package manager. To use a hardware target, refer to Use a hardware target.
Before you start
Make sure that you have the following:
A commercial or non-commercial QNX license added to your account at qnx.com.
QNX SDP 8.0 installed through the QNX Software Center. Refer to Install the QNX SDP.
A QNX target that is reachable over SSH: a QEMU virtual machine or a board, such as Raspberry Pi 5. Refer to Create and boot a QNX target in QEMU.
Prepare the QNX environment
Install the QNX SDP
Log in to your account at qnx.com and download the QNX Software Center for Linux.
Run the installer from the directory that you downloaded it to:
cd ~/Downloads chmod +x qnx-setup-*-linux.run ./qnx-setup-*-linux.runIn the QNX Software Center, select Add Installation and install QNX Software Development Platform 8.0. The default installation directory is ~/qnx800.

To check the installation, load the SDP environment in a terminal and list the available compiler targets:
source ~/qnx800/qnxsdp-env.sh qcc -VThe output lists the GCC-based targets for x86_64 and AArch64, for example:
cc: targets available in /home/<user>/qnx800/host/linux/x86_64/etc/qcc: 12.2.0,gcc_ntox86_64_gpp 12.2.0,gcc_ntox86_64_cxx 12.2.0,gcc_ntoaarch64le 12.2.0,gcc_ntox86_64 (default) 12.2.0,gcc_ntoaarch64le_gpp 12.2.0,gcc_ntoaarch64le_cxx
The qnxsdp-env.sh script adds the QNX tools to PATH and sets the QNX_HOST and QNX_TARGET variables, which point to the host binaries and to the QNX headers and libraries. The script affects only the current terminal session, so run it again in every new terminal. CLion runs the same script to set up the toolchain, so you do not need to run it for the IDE.
Set up QEMU
The mkqnximage tool from the SDP builds a QNX image for QEMU. The image uses the virtual network of libvirt to connect the target to your computer.
Install QEMU and the networking packages:
sudo apt update sudo apt install qemu-system-x86 qemu-utils libvirt-clients libvirt-daemon-system net-tools bridge-utils dnsmasqTo build an AArch64 image, also install
qemu-system-arm.Add your user to the
kvmandlibvirtgroups so that QEMU can use hardware virtualization:sudo usermod -aG kvm,libvirt "$USER"Restart your computer to apply the group membership.
Check that the
defaultnetwork of libvirt is active:virsh --connect qemu:///system net-list --allIf
virshreportsPermission denied, runid -nGand check that the output listskvmandlibvirt.If the
defaultnetwork is inactive, start it and enable it on boot:sudo virsh net-start default sudo virsh net-autostart default
Create and boot a QNX target in QEMU
Open the Terminal tool window (Alt+F12). Load the SDP environment, create a directory for the image, check the host network setup, and then build and boot the image:
source ~/qnx800/qnxsdp-env.sh mkdir -p ~/qnx-target && cd ~/qnx-target ~/qnx800/host/common/mkqnximage/qemu/check-net mkqnximage --type=qemu --arch=x86_64 mkqnximage --runThe target boots in the Terminal tool window, and its console replaces the local shell. When the output shows
Startup complete, the target is running, and its SSH server is started. The console opens a shell without a login prompt.In the target shell, run
ifconfigand copy theinetaddress of thevtnet0interface. On thedefaultnetwork of libvirt, the address is in the192.168.122.xrange.
Check the SSH connection from your computer. The default image has several users whose passwords match their names, for example,
rootwith the passwordroot:ssh root@192.168.122.202
To shut down the target, press Ctrl+A and then X in its console. Alternatively, open a new tab in the Terminal tool window, load the SDP environment, and run mkqnximage --stop from ~/qnx-target. To start the target again, run mkqnximage --run from ~/qnx-target in a Terminal tab where you loaded the SDP environment.
Open a QNX project
Open the project and connect it to the SDP
Clone the sample project: click Clone Repository on the Welcome screen, or select in the main menu.
CLion detects the Makefile and opens the Load Project dialog with the Clean project checkbox selected.

Keep the checkbox selected and click OK. Make builds incrementally, so loading an uncleaned project skips the source files whose targets are up to date.
At this point, CLion does not have the SDP configured. The first load reports
No compilation commands found, and the editor shows that the files do not belong to any project target.Press Ctrl+Alt+S to open settings and select .
Make sure that the Enable QNX OS integration checkbox is selected, and configure the following settings:
- SDP path
The directory with the installed SDP. CLion detects it automatically. To use another directory, make sure that it contains the qnxsdp-env.sh script.
- Target
The SSH connection to the target. Select <create configuration> and create an SSH configuration:
Host: the IP address of the target.
Port:
22.Username:
root.Authentication type: Password.
Password:
root. Optionally, select Save password.Keep the Legacy session backend selected.
Click Test Connection to check that CLion can reach the target.
- Upload path
The directory on the target where CLion uploads the built binary. The program also runs there unless the run configuration sets a working directory. The default value is /tmp.

Click OK. CLion reloads the Makefile project and analyzes the code with
qccand the QNX headers from the SDP.
Build and run a QNX project
Build the project
In the run/debug configuration switcher, select all. The other configurations come from the QNX build system, and you can ignore or delete them.
(Optional) Limit the build to the architectures and variants that you need. By default, the sample project builds for x86_64 and AArch64. In , set Build options, for example, to
--jobs=8 CPULIST=x86_64 VARIANTLIST=gto build only an x86_64 debug binary.CPULISTandVARIANTLISTare standard variables of the QNX recursive build. The value of the field replaces the default--jobsoption of CLion, so add this option yourself.Click
Build (Ctrl+F9) on the main toolbar.

Run the program on the target
Select from the main menu and select the all configuration.
In the Executable field, specify the path to the built binary on your computer. For the sample project, it is ~/CLionProjects/qnx-sample-blog/nto/x86_64/o-g/qnx-sample-blog_g.
(Optional) Specify Program arguments, for example,
a b c.Click OK, and then click
Run (Shift+F10).
CLion uploads the binary to the upload path on the target and runs it there. The program output appears in the Run tool window.
/bin/sh -l -c "cd -- \"$1\" && shift && exec \"$@\"" sh /tmp /tmp/qnx-sample-blog_g a b c ============================================= QNX sample application configure / build / run / debug from CLion ============================================= Executable: /tmp/qnx-sample-blog_g Working directory: /data/var/tmp Arguments (4): argv[0] = /tmp/qnx-sample-blog_g argv[1] = a argv[2] = b argv[3] = c Argument statistics: length[0] = 22 length[1] = 1 length[2] = 1 length[3] = 1 arguments : 4 total : 25 bytes longest : "/tmp/qnx-sample-blog_g" Environment: (omitted - rebuild with SHOW_ENV=1 to include it) Process finished with exit code 0
Debug a QNX project
To debug on a QNX target, you need a debug profile of the QNX OS type. The profile defines the GDB from the SDP, and the target and the upload path come from the QNX OS settings.
Create a QNX OS debug profile
Press Ctrl+Alt+S to open settings and select .
Click
Add and select QNX OS.
Configure the profile:
Name: a name for the profile.
Debugger: the GDB from the SDP for your target architecture. For an x86_64 target, it is ~/qnx800/host/linux/x86_64/usr/bin/ntox86_64-gdb. For an AArch64 target, select ntoaarch64-gdb from the same directory.
The Available for all projects checkbox is selected by default, so you can use the profile in other QNX projects.

Click OK.
Start a debug session
In the debug profile switcher on the main toolbar, select the QNX OS profile.
Set breakpoints in your code. In the sample project, for example, open argstats.c and set a breakpoint at
size_t len = strlen(argv[i]);.Click
Debug (Shift+F9).
CLion uploads the binary to the target and starts a debug session. When the program stops at the breakpoint, you can step through the code and examine the program state.

You can also let an AI agent debug the program on the target. For example, the sample project crashes with SIGSEGV when you pass more than three arguments, such as a b c d. When you ask an agent to find the cause, the agent can run a debug session by using the MCP tools of CLion. For more information, refer to Agentic debugging.
Use a hardware target
Running and debugging on a board, such as Raspberry Pi 5, works the same way as on a QEMU target. The differences are how you get the IP address of the target and which binaries and debugger you select.
The following procedure assumes that you have installed the QNX SDP, connected the board to your computer, and booted a QNX image on it. For Raspberry Pi 5, you can get the image from the SDP 8.0 BSP for Raspberry Pi 5 package in the QNX Software Center. This example uses the UART serial port to get the IP address and the LAN port for the SSH connection.
Configure a hardware target
Open the Serial Connections tool window: press Shift Shift and search for it.
Select the port of your board, for example, /dev/ttyACM0, and click Connect.

In the console, run
ifconfigand copy theinetaddress of the board.
Specify this address in the Target SSH configuration in the QNX OS settings.
For an AArch64 board, select the AArch64 binaries:
In the Executable field of the run configuration, specify the AArch64 binary.
In the Debugger field of the debug profile, select ntoaarch64-gdb.