2011-09-27 11:55:44 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-25 16:28:25 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2011-09-27 11:55:44 +02:00
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2011-09-27 11:55:44 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Free Documentation License
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file included in the packaging of this
|
|
|
|
|
** file.
|
|
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
// NOTE: the sections are not ordered by their logical order to avoid
|
|
|
|
|
// reshuffling the file each time the index order changes (i.e., often).
|
|
|
|
|
// Run the fixnavi.pl script to adjust the links to the index order.
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\contentspage index.html
|
|
|
|
|
\previouspage creator-project-qmake.html
|
|
|
|
|
\page creator-tool-chains.html
|
|
|
|
|
\nextpage creator-run-settings.html
|
|
|
|
|
|
|
|
|
|
\title Adding Tool Chains
|
|
|
|
|
|
2012-08-13 15:58:25 +02:00
|
|
|
A \e {tool chain} specifies a compiler and other necessary
|
2011-09-27 11:55:44 +02:00
|
|
|
tools for building an application that is \l{glossary-development-target}
|
|
|
|
|
{targeted} for a particular platform. \QC automatically detects the tool
|
|
|
|
|
chains that are registered by your system or by \QSDK.
|
|
|
|
|
|
|
|
|
|
You can add tool chains to build applications by using other compilers or
|
|
|
|
|
with different versions of the automatically detected compilers:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
|
|
|
|
\o GNU Compiler Collection (GCC) is a compiler for Linux and
|
|
|
|
|
Mac OS X.
|
|
|
|
|
|
|
|
|
|
\o 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 \QC and Qt SDK for Windows.
|
|
|
|
|
|
|
|
|
|
\o Linux ICC (Intel C++ Compiler) is a group of C and C++ compilers
|
|
|
|
|
for Linux.
|
|
|
|
|
|
|
|
|
|
\o Clang is a C, C++, Objective C, and Objective C++ front-end for the
|
2012-08-13 15:58:25 +02:00
|
|
|
LLVM compiler for Windows, Linux, and Mac OS X.
|
2011-09-27 11:55:44 +02:00
|
|
|
\endlist
|
|
|
|
|
|
2012-08-22 13:27:25 +02:00
|
|
|
To build an application using GCC, MinGW, or Clang, specify the paths
|
|
|
|
|
to the directories where the compiler and debugger are located and select
|
2011-09-27 11:55:44 +02:00
|
|
|
the application binary interface (ABI) version from the list of available
|
|
|
|
|
versions. You can also create a custom ABI definition.
|
|
|
|
|
|
2012-08-13 15:58:25 +02:00
|
|
|
You specify the tool chain to use for each \l{glossary-development-target}
|
|
|
|
|
{target} in \gui Tools > \gui Options > \gui {Build & Run} > \gui Targets.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
|
|
|
|
To add tool chains:
|
|
|
|
|
|
|
|
|
|
\list 1
|
|
|
|
|
|
2011-10-18 11:27:30 +02:00
|
|
|
\o Select \gui {Tools > Options > Build & Run > Tool Chains > Add} and
|
|
|
|
|
select a
|
2011-09-27 11:55:44 +02:00
|
|
|
compiler in the list.
|
|
|
|
|
|
|
|
|
|
\image qtcreator-toolchains.png
|
|
|
|
|
|
|
|
|
|
To clone the selected tool chain, select \gui {Clone}.
|
|
|
|
|
|
|
|
|
|
\o In the \gui Name column, double-click the name to change it.
|
|
|
|
|
|
|
|
|
|
\o In the \gui{Compiler path} field, enter the path to the directory
|
|
|
|
|
where the compiler is located.
|
|
|
|
|
\if defined(qcmanual)
|
|
|
|
|
For WINSCW, enter the path to the Carbide C++ installation directory
|
|
|
|
|
here.
|
|
|
|
|
\endif
|
|
|
|
|
|
|
|
|
|
The other settings to specify depend on the tool chain.
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
\section2 Troubleshooting MinGW Compilation Errors
|
|
|
|
|
|
|
|
|
|
If error messages displayed in the \gui {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:
|
|
|
|
|
|
|
|
|
|
\code
|
|
|
|
|
where sh.exe
|
|
|
|
|
where make.exe
|
|
|
|
|
where mingw32-make.exe
|
|
|
|
|
\endcode
|
|
|
|
|
|
|
|
|
|
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 {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 \e path_to, which should be in a convenient
|
|
|
|
|
location. In the file, specify the paths to the tool chains. For example,
|
|
|
|
|
|
|
|
|
|
\c {set PATH=C:\path1;C:\path2;%PATH%}
|
|
|
|
|
|
|
|
|
|
where \e path1 and \e path2 are paths to the tool chains.
|
|
|
|
|
|
|
|
|
|
Finally, remove the paths from the global PATH, reboot the computer, and
|
|
|
|
|
run the \c 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.
|
|
|
|
|
|
|
|
|
|
*/
|