在Qt Creator中配置QNX编译工具链

7 篇文章 12 订阅

Configuring a toolchain in Qt Creator

After defining a QNX device to represent your target system, you must set up a toolchain in Qt Creator. The toolchain defines the build and run environment based on the QNX QDF installation and the compiler, debugger, and target device configurations.

To configure a toolchain in Qt Creator:
  1. In the IDE, select the Tools menu, then click Options to open the Options dialog.

  2. Choose Build & Run in the left-side menu, click the Qt Versions tab in the main viewing area, then click the Add... button on the right side.

    The IDE opens a file selector.

  3. In the file selector, either navigate to C:\QtQNX\Qt520\bin and select qmake.exe (on Windows) or navigate to /base/qt5-5.2/bin and select qmake (on Linux), then click Open.

    The Options dialog displays additional fields for configuring the selected Qt version.

  4. At the bottom of the dialog, on the line that reads QNX Software Development Platform, click Browse....

    The IDE opens another file selector.

  5. Navigate to DEFAULT_SDP_PATH and click Select Folder.

    The QNX Software Development field now lists the directory containing the QNX SDP 6.6 installation on your host system.

  6. Click the Compilers tab, click the Add button on the right side, then select QCC from the dropdown list.

    The Options dialog displays additional fields at the bottom for configuring the newly added compiler.

  7. Fill in the compiler fields:

    1. In the Name field, enter QNX SDP 6.6 QCC.

    2. On the Compiler path line, click Browse... to open the file selector. On Windows, navigate toDEFAULT_SDP_PATH\host\win32\x86\usr\bin and choose qcc.exe. On Linux, navigate to DEFAULT_SDP_PATH/host/linux/x86/usr/binand choose qcc. Click Select Folder to confirm the setting.

    3. On the NDK/SDP path line, click Browse... to open the file selector, navigate to DEFAULT_SDP_PATH, then click Select Folder.

    4. In the dropdown list for ABI, select arm-linux-generic-elf-32bit.

  8. Click the Apply button in the bottom right corner to save these settings.

  9. Click the Debuggers tab, then click the Add button on the right side.

    The Options dialog displays additional fields at the bottom for configuring a new debugger.

  10. Fill in the debugger fields:

    1. In the Name field, enter QNX SDP 6.6 GDB.

    2. On the Path line, click Browse... to open the file selector. On Windows, navigate to DEFAULT_SDP_PATH\host\win32\x86\usr\bin and choose ntoarmv7-gdb.exe. On Linux, navigate to DEFAULT_SDP_PATH/host/linux/x86/usr/bin and choose ntoarmv7-gdb. Click Select Folder to confirm the setting.

  11. Click the Apply button in the bottom right corner to save these settings.

  12. Click the Kits tab, then click the Add button on the right side.

    The Options dialog displays additional fields at the bottom for configuring a new kit.

  13.  Fill in the kits fields:

    1. Name the kit something meaningful, like QNX SDP 6.6 – OMAP5432.

    2. In the Device Type dropdown list, select QNX Device.

    3. In the Device dropdown list, select the device configured earlier (e.g., OMAP5432).

    4. In the Compiler dropdown list, select QNX SDP 6.6 QCC.

    5. In the Debugger dropdown list, select QNX SDP 6.6 GDB.

    6. In the Qt version dropdown list, select Qt 5.2.0 (Qt520).

  14. Click the OK button in the bottom right corner to save all the Build & Run settings.

After you've configured a QNX device and a toolchain, you can begin developing Qt apps for QNX CAR 2.1! When creating Qt apps, you can select your Build & Run Kit in the  New Project wizard to use the build and run settings that you configured earlier.

Qt Creator是一款开发Qt应用程序的集成开发环境,可以用于开发和调试QNX应用程序。下面是在Qt Creator搭建编译QNX代码的环境的基本步骤。 1. 安装QNX SDP 首先需要在本地机器上安装QNX Software Development Platform (SDP)。安装过程可以参考QNX官网的指南,安装完成后需要配置好环境变量。 2. 安装Qt CreatorQt官网上下载并安装Qt Creator,安装过程简单,按照默认选项即可。 3. 配置Qt Creator 打开Qt Creator,在“工具”菜单选择“选项”,在“Kits”选项卡下,添加一个新的Qt版本和一个新的编译器。 - 添加Qt版本: 点击“添加”按钮,在弹出的对话框选择“QNX”,然后设置Qt版本的路径和名称。例如,Qt 5.9.5的路径为“/opt/qnx700/host/qnx6/x86/usr/qt5”,名称为“Qt 5.9.5 (QNX 7.0)”。 - 添加编译器: 点击“添加”按钮,在弹出的对话框选择“QNX”,然后设置编译器的路径和名称。例如,QNX SDP 7.0的编译器路径为“/opt/qnx700/host/linux/x86/usr/bin/qcc”,名称为“QCC (QNX 7.0)”。 4. 创建新项目 在Qt Creator创建一个新项目,选择“Qt Console Application”,然后在“项目配置”步骤选择新添加的Qt版本和编译器。 5. 配置项目 在项目的“构建设置”,设置编译器和接器的参数,包括头文件路径、库文件路径和接器参数等。 6. 编译和运行项目 在Qt Creator编译和运行项目,如果一切顺利,则可以在QNX系统上运行生成的可执行文件。 注意:在配置编译过程,需要确保环境变量和路径设置正确,否则可能会出现编译接错误。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值