Qt Creator Manual

Adding Tool Chains

A tool chain specifies a compiler and a debugger and other necessary tools for building an application that is targeted for a particular platform. Qt Creator automatically detects the tool chains that are registered by your system or by Qt SDK.

You can add tool chains to build applications by using other compilers or with different versions of the automatically detected compilers:

  • GNU Compiler Collection (GCC) is a compiler for Linux and Mac OS X.
  • MinGW (Minimalist GNU for Windows) is a native software port of GCC and GNU Binutils for use in the development of native Microsoft Windows applications on Windows. MinGW is distributed together with Qt Creator and Qt SDK for Windows.
  • Linux ICC (Intel C++ Compiler) is a group of C and C++ compilers for Linux.
  • Clang is a C, C++, Objective C, and Objective C++ front-end for the LLVM compiler for Windows, Linux, Mac OS X, and Symbian.
  • GCCE (GNU Compiler Collection for Embedded) is an ARM-based compiler used in Symbian OS 9 and distributed together with Qt SDK.
  • RVCT is an ARM-based compiler for building applications for Symbian devices (requires a license).
  • WINSCW is a compiler for building applications that can be run or debugged on the Symbian Emulator. It is distributed together with Symbian SDKs (but not with the Qt SDK).

To build an application using GCC, MinGW, GCCE, or Clang, specify the paths to the directories where the compiler and debugger are located and select the application binary interface (ABI) version from the list of available versions. You can also create a custom ABI definition.

Qt Creator allows you to select a tool chain that matches the Qt version in the Projects mode Build Settins.

To add tool chains:

  1. Select Tools > Options > Build & Run > Tool Chains > Add and select a compiler in the list.

    To clone the selected tool chain, select Clone.

  2. In the Name column, double-click the name to change it.
  3. In the Compiler path field, enter the path to the directory where the compiler is located. For WINSCW, enter the path to the Carbide C++ installation directory here. The other settings to specify depend on the tool chain.
  4. For RVCT, select the ARM version to use in the ARM version field. RVCT 2.2 is supported on Symbian Anna and earlier. RVCT 4.0 b902 or later is required for Symbian Belle.

Troubleshooting MinGW Compilation Errors

If error messages displayed in the Compile Output pane contain paths where slashes are missing (for example, C:QtSDK), check your PATH variable. At the command line, enter the following commands:

 where sh.exe
 where make.exe
 where mingw32-make.exe

If these commands show paths, they have been added to the global PATH variable during the installation of a tool chain based on Cygwin or MinGW, even though this is against Windows conventions.

To keep working with the third-party tool chain, create a new shell link that adds the required paths (as Visual Studio and Qt do). The shell link must point to cmd.exe, as illustrated by the following example:

C:\Windows\System32\cmd.exe /K C:\path_to\myenv.bat

where the /K parameter carries out the command specified in the bat file.

Create the myenv.bat file at path_to, which should be in a convenient location. In the file, specify the paths to the tool chains. For example,

set PATH=C:\path1;C:\path2;%PATH%

where path1 and path2 are paths to the tool chains.

Finally, remove the paths from the global PATH, reboot the computer, and run the where commands again to verify that the global PATH is now clean.

You can use the shell link to run the tools in the third-party tool chains.