Skip to content

Cross Compile with QtCreator

Adam Lee edited this page Aug 17, 2015 · 1 revision

###QtCreator Remote Development And Deployment with SDK Note: This article is builds on the Qt5 development.

####Install Visit the download section at Qt.io and grab the web installer. It lets you pick the exact version of QtCreator (3.4.2 in this case), and as well as the version of Qt5 (5.4). These versions are expected by meta-qt5. Also note that the web installer will ask you to create an account. This is normal.

qt5-web-install

####Configuration We will configure QtCreator with cross compiler, debugger, and Qt library which are all included in the Qt5 SDK. However we still have to make sure the environment supplied by the SDK is sourced before launching QtCreator:

$ source /opt/poky/1.8/environments-etup-cortexa8hf-vfp-neon-poky-linux-gnueabi

And then be sure to start up Qt Creator from the same shell:

$ ~/qtcreator-3.4.2/bin/qtcreator.sh

Note that we are executing the .sh file, not the qtcreator binary. The shell script configures the environment in addition to running the binary.

Once it launches, we can set the compilers, debuggers, a kit, and a remote device. Make sure to use the cross-toolchains available from the SDK. Take a look at the screenshots for detail:

Remote Device: Below is an example of the remote device setup for Gumstix Overo. You can test the connection using the Test button. qt5-creator-configuration-4

Cross Compiler: Select the cross-compiler, provided in the SDK: qt5-creator-configuration

Remote Debugger: To run a remote debugger, we also seqt5-creator-configuration-2

Kit: A Kit as shown below is composed of a remote device, compiler, debugger, a specific version of Qt5 and etc. You can have multiple kits. A kit can be associated to a project to ease the build configurations:

qt5-creator-configuration-3

Runtime Environment Variables: The last thing to do is setting up the runtime environment variables. Be sure to switch your view to Projects from Edit.

Here are some useful variables for instance:

  • QT_QPA_PLATFORM = linuxfb eliminates the need for -platform linux parameter
  • DISPLAY = :0.0 sets the default display to run the Qt app on

qt5-creator-configuration-5

Now QtCreator is ready for remote application development and debugging!