README.md 16.1 KB
Newer Older
Eike Ziller's avatar
Eike Ziller committed
1 2
# Qt Creator

Kai Koehne's avatar
Kai Koehne committed
3
Qt Creator is a cross-platform IDE for development with the Qt framework.
con's avatar
con committed
4

Eike Ziller's avatar
Eike Ziller committed
5 6
## Supported Platforms

7
The standalone binary packages support the following platforms:
con's avatar
con committed
8

9 10
Windows 7 or later
(K)Ubuntu Linux 14.04 (64-bit) or later
11
macOS 10.8 or later
con's avatar
con committed
12

Eike Ziller's avatar
Eike Ziller committed
13 14
## Compiling Qt Creator

con's avatar
con committed
15
Prerequisites:
Eike Ziller's avatar
Eike Ziller committed
16

17
* Qt 5.6.0 or later
18
* Qt WebEngine module for QtWebEngine based help viewer
Eike Ziller's avatar
Eike Ziller committed
19 20
* On Windows:
    * ActiveState Active Perl
21
    * MinGW with g++ 4.8 or Visual Studio 2015 or later
Eike Ziller's avatar
Eike Ziller committed
22
    * jom
Friedemann Kleint's avatar
Friedemann Kleint committed
23 24 25

  The optional Clang code model requires LLVM. A manual build of it requires in addition:
    * cmake
Eike Ziller's avatar
Eike Ziller committed
26
* On Mac OS X: latest Xcode
27
* On Linux: g++ 4.8 or later
Nikolai Kosjar's avatar
Nikolai Kosjar committed
28
* LLVM 3.9.0 or later (optional, needed for the Clang Code Model)
29
* Qbs 1.7.x (optional, sources also contain Qbs itself)
30 31

The installed toolchains have to match the one Qt was compiled with.
con's avatar
con committed
32

33
You can build Qt Creator with
34

35 36
    # Optional, needed for the Clang Code Model:
    export LLVM_INSTALL_DIR=/path/to/llvm (or "set" on Windows)
37 38
    # Optional, needed to let the QbsProjectManager plugin use system Qbs:
    export QBS_INSTALL_DIR=/path/to/qbs
39

40 41 42 43 44 45 46
    cd $SOURCE_DIRECTORY
    qmake -r
    make (or mingw32-make or nmake or jom, depending on your platform)

Installation ("make install") is not needed. It is however possible, using

    make install INSTALL_ROOT=$INSTALL_DIRECTORY
con's avatar
con committed
47

Eike Ziller's avatar
Eike Ziller committed
48
## Compiling Qt and Qt Creator on Windows
49 50 51 52

This section provides step by step instructions for compiling the latest
versions of Qt and Qt Creator on Windows. Alternatively, to avoid having to
compile Qt yourself, you can use one of the versions of Qt shipped with the Qt
53
SDK (release builds of Qt using MinGW and Visual C++ 2015 or later).
Friedemann Kleint's avatar
Friedemann Kleint committed
54
For detailed information on the supported compilers, see
Eike Ziller's avatar
Eike Ziller committed
55
<https://wiki.qt.io/Building_Qt_5_from_Git> .
56 57 58 59 60

   1.  Decide which compiler to use: MinGW or Microsoft Visual Studio. If you
       plan to contribute to Qt Creator, you should compile your changes with
       both compilers.

Eike Ziller's avatar
Eike Ziller committed
61
   2.  Install msysGit from <https://msysgit.github.io/>. If you plan to
62 63 64 65 66
       use the MinGW compiler suite, do not choose to put git in the
       default path of Windows command prompts. For more information, see
       step 9.

   3.  Create a working directory under which to check out Qt and Qt Creator,
Eike Ziller's avatar
Eike Ziller committed
67
       for example, `c:\work`. If you plan to use MinGW and Microsoft Visual
68 69
       Studio simultaneously or mix different Qt versions, we recommend
       creating a directory structure which reflects that. For example:
70
       `C:\work\qt5.6.0-vs12, C:\work\qt5.6.0-mingw`.
71

Eike Ziller's avatar
Eike Ziller committed
72 73
   4.  Download and install Perl from <https://www.activestate.com/activeperl>
       and check that perl.exe is added to the path. Run `perl -v` to verify
Friedemann Kleint's avatar
Friedemann Kleint committed
74 75
       that the version displayed is 5.10 or later. Note that git ships
       an outdated version 5.8 which cannot be used for Qt.
76

Eike Ziller's avatar
Eike Ziller committed
77 78
   5.  In the working directory, check out the respective branch of Qt from
       <https://code.qt.io/cgit/qt/qt5.git> (we recommend the latest released version).
79

Friedemann Kleint's avatar
Friedemann Kleint committed
80
   6.  Check out Qt Creator (master branch or latest version, see
Eike Ziller's avatar
Eike Ziller committed
81
       <https://code.qt.io/cgit/qt-creator/qt-creator.git>).
82 83 84 85
       You should now have the directories qt and creator under your working
       directory.

   7.  Install a compiler:
Eike Ziller's avatar
Eike Ziller committed
86
       - For a MinGW toolchain for Qt, see <https://wiki.qt.io/MinGW> .
87 88 89 90 91 92 93 94

       - For Microsoft Visual C++, install the Windows SDK and the "Debugging
         Tools for Windows" from the SDK image. We strongly recommend using the
         64-bit version and 64-bit compilers on 64-bit systems.

         For the Visual C++ compilers, it is recommended to use the tool 'jom'.
         It is a replacement for nmake that utilizes all CPU cores and thus
         speeds up compilation significantly. Download it from
Eike Ziller's avatar
Eike Ziller committed
95
         <https://download.qt.io/official_releases/jom>
Friedemann Kleint's avatar
Friedemann Kleint committed
96
         and add the executable to the path.
97 98 99

   8.  For convenience, we recommend creating shell prompts with the correct
       environment. This can be done by creating a .bat-file
Eike Ziller's avatar
Eike Ziller committed
100
       (such as, `<working_directory>\qtvars.bat`) that contains the environment
101
       variable settings.
Eike Ziller's avatar
Eike Ziller committed
102
       A `.bat`-file for MinGW looks like:
103

Friedemann Kleint's avatar
Friedemann Kleint committed
104
         set PATH=<path_to_qt>\[qtbase\]bin;<path_to_mingw>\bin;<working_directory>\creator\bin;%PATH%
105 106
         set QMAKESPEC=win32-g++

Eike Ziller's avatar
Eike Ziller committed
107
       For the Visual C++ compilers, call the `.bat` file that sets up the
108 109 110
       environment for the compiler (provided by the Windows SDK or the
       compiler):

111
         CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
Friedemann Kleint's avatar
Friedemann Kleint committed
112
         set PATH=<path_to_qt>\[qtbase\]bin;<working_directory>\creator\bin;%PATH%
113
         set QMAKESPEC=win32-msvc2013
114

Eike Ziller's avatar
Eike Ziller committed
115
       You can create desktop links to the `.bat` files using the working
116 117
       directory and specifying

Eike Ziller's avatar
Eike Ziller committed
118
        %SystemRoot%\system32\cmd.exe /E:ON /V:ON  /k <working_directory>\qtvars.bat
119 120 121

   9.  When using MinGW, open the shell prompt and enter:

Eike Ziller's avatar
Eike Ziller committed
122
        sh.exe
123

Eike Ziller's avatar
Eike Ziller committed
124 125
       That should result in a `sh is not recognized as internal or external
       command...` error. If a `sh.exe` is found, the compile process will fail.
126 127
       You have to remove it from the path.

Friedemann Kleint's avatar
Friedemann Kleint committed
128 129 130 131 132
   10. As of Qt Creator 4.2, a complete build of LLVM and Clang is required
       to enable the Clang-based code model (recommmended: 3.9). For 32bit,
       a pre-built package can be downloaded from:
       https://download.qt.io/development_releases/prebuilt/libclang/.
       The environment variable LLVM_INSTALL_DIR needs to be set to point to the
133
       installation location.
Friedemann Kleint's avatar
Friedemann Kleint committed
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
       It is also possible to build Clang manually, roughly following the
       instructions at http://llvm.org/docs/GettingStarted.html#git-mirror .
       * Clone LLVM
             git clone http://llvm.org/git/llvm.git
       * Switch to a suitable branch, for example, release_39
             cd llvm
             git checkout -b release_39
       * Clone Clang under llvm\tools
             cd tools
             git clone http://llvm.org/git/clang.git
       * Switch Clang to a suitable branch
             cd clang
             git checkout -b release_39
       * Create a shadow build directory and build
             cd ..\..\..
             mkdir build
             cd build
             cmake -G "NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=<installation location> -DLLVM_ENABLE_RTTI=ON ..\llvm
             jom install

154 155

  11.  You are now ready to configure and build Qt and Qt Creator.
Eike Ziller's avatar
Eike Ziller committed
156
       Please see <https://wiki.qt.io/Building_Qt_5_from_Git> for
Friedemann Kleint's avatar
Friedemann Kleint committed
157
       recommended configure-options for Qt 5.
158 159
       To use MinGW, open the the shell prompt and enter:

Friedemann Kleint's avatar
Friedemann Kleint committed
160 161
         cd <path_to_qt>
         configure <configure_options> && mingw32-make -s
162 163 164 165 166
         cd ..\creator
         qmake && mingw32-make -s

       To use the Visual C++ compilers, enter:

Friedemann Kleint's avatar
Friedemann Kleint committed
167 168
         cd <path_to_qt>
         configure <configure_options> && jom
169 170 171
         cd ..\creator
         qmake && jom

172
   12. To launch Qt Creator, enter:
173 174
       qtcreator

175 176 177 178 179 180 181 182
   13. To test the Clang-based code model, verify that backend process
         bin\clangbackend.exe
       launches (displaying its usage).

       The library libclang.dll needs to be copied to the bin directory if
       Clang cannot be found in the path.

   14. When using  Visual C++ with the "Debugging Tools for Windows" installed,
Eike Ziller's avatar
Eike Ziller committed
183 184 185
       the extension library `qtcreatorcdbext.dll` to be loaded into the
       Windows console debugger (`cdb.exe`) should have been built under
       `lib\qtcreatorcdbext32` or `lib\qtcreatorcdbext64`.
186 187
       When using a 32 bit-build of Qt Creator with the 64 bit version of the
       "Debugging Tools for Windows" the library should also be built with
Eike Ziller's avatar
Eike Ziller committed
188
       a 64 bit compiler (rebuild `src\libs\qtcreatorcdbext` using a 64 bit
189 190
       compiler).

Friedemann Kleint's avatar
Friedemann Kleint committed
191 192
       If you are building 32 bit and running on a 64 bit
       Windows, you can obtain the 64 bit versions of the extension library
Eike Ziller's avatar
Eike Ziller committed
193
       and the binary `win64interrupt.exe`, which is required for
Friedemann Kleint's avatar
Friedemann Kleint committed
194
       debugging from the repository
Eike Ziller's avatar
Eike Ziller committed
195
       <https://code.qt.io/cgit/qt-creator/binary-artifacts.git/tree> .
Friedemann Kleint's avatar
Friedemann Kleint committed
196

197
   15. Qt Creator can be registered as a post-mortem debugger. This
Friedemann Kleint's avatar
Friedemann Kleint committed
198 199 200 201
       can be done in the options page or by running the tool qtcdebugger
       with administrative privileges passing the command line options
       -register/unregister, respectively. Alternatively,
       the required registry entries
Eike Ziller's avatar
Eike Ziller committed
202 203 204 205

        HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
        HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug

Friedemann Kleint's avatar
Friedemann Kleint committed
206
       can be modified using the registry editor regedt32 to contain
Eike Ziller's avatar
Eike Ziller committed
207 208

        <path>\qt-creator\bin\qtcdebugger %ld %ld
Friedemann Kleint's avatar
Friedemann Kleint committed
209 210 211 212 213

       When using a self-built version of Qt Creator as post-mortem debugger, it needs to be
       able to find all dependent Qt-libraries and plugins when being launched by the
       system. The easiest way to provide them for Qt 5 is to run the tool windeployqt:

214
        windeployqt -quick -qmldir share\qtcreator\welcomescreen -qmldir src\plugins\qmlprofiler bin\qtcreator.exe lib\qtcreator lib\qtcreator\plugins
Friedemann Kleint's avatar
Friedemann Kleint committed
215

216 217 218 219 220 221
Note that unlike on Unix, you cannot overwrite executables that are running.
Thus, if you want to work on Qt Creator using Qt Creator, you need a
separate build of it. We recommend using a separate, release-built version
of Qt and Qt Creator to work on a debug-built version of Qt and Qt Creator
or using shadow builds.

Eike Ziller's avatar
Eike Ziller committed
222 223
## Third-party Components

Kai Koehne's avatar
Kai Koehne committed
224
Qt Creator includes the following third-party components,
con's avatar
con committed
225 226
we thank the authors who made this possible:

Eike Ziller's avatar
Eike Ziller committed
227
### Open Source front-end for C++ (license MIT), enhanced for use in Qt Creator
228

con's avatar
con committed
229
  Roberto Raggi <roberto.raggi@gmail.com>
hjk's avatar
hjk committed
230

con's avatar
con committed
231 232
  QtCreator/src/shared/cplusplus

hjk's avatar
hjk committed
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
  Copyright 2005 Roberto Raggi <roberto@kdevelop.org>

  Permission to use, copy, modify, distribute, and sell this software and its
  documentation for any purpose is hereby granted without fee, provided that
  the above copyright notice appear in all copies and that both that
  copyright notice and this permission notice appear in supporting
  documentation.

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
### Open Source tool for generating C++ code that classifies keywords (license MIT)

  Roberto Raggi <roberto.raggi@gmail.com>

  QtCreator/src/tools/3rdparty/cplusplus-keywordgen

  Copyright (c) 2007 Roberto Raggi <roberto.raggi@gmail.com>

  Permission is hereby granted, free of charge, to any person obtaining a copy of
  this software and associated documentation files (the "Software"), to deal in
  the Software without restriction, including without limitation the rights to
  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  the Software, and to permit persons to whom the Software is furnished to do so,
  subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
hjk's avatar
hjk committed
275

Eike Ziller's avatar
Eike Ziller committed
276
### Botan, a C++ crypto library. Version 1.10.2
Kai Koehne's avatar
Kai Koehne committed
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295

  Botan (http://botan.randombit.net/) is distributed under these terms::

  Copyright (C) 1999-2011 Jack Lloyd
                2001 Peter J Jones
                2004-2007 Justin Karneges
                2004 Vaclav Ovsik
                2005 Matthew Gregan
                2005-2006 Matt Johnston
                2006 Luca Piccarreta
                2007 Yves Jerschow
                2007-2008 FlexSecure GmbH
                2007-2008 Technische Universitat Darmstadt
                2007-2008 Falko Strenzke
                2007-2008 Martin Doering
                2007 Manuel Hartl
                2007 Christoph Ludwig
                2007 Patrick Sona
                2010 Olivier de Gaalon
296 297 298
  All rights reserved.

  Redistribution and use in source and binary forms, with or without
Kai Koehne's avatar
Kai Koehne committed
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
  modification, are permitted provided that the following conditions are
  met:

  1. Redistributions of source code must retain the above copyright
  notice, this list of conditions, and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions, and the following disclaimer in the
  documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) "AS IS" AND ANY EXPRESS OR
  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
  ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
320 321 322 323

  The source code of Botan C++ crypto library can be found in
  QtCreator/src/libs/3rdparty

324 325 326
### SQLite, in-process library that implements a SQL database engine

SQLite (https://www.sqlite.org) is in the Public Domain.
hjk's avatar
hjk committed
327

Eike Ziller's avatar
Eike Ziller committed
328
### ClassView and ImageViewer plugins
hjk's avatar
hjk committed
329

330
  Copyright (C) 2016 The Qt Company Ltd.
hjk's avatar
hjk committed
331 332

  All rights reserved.
333
  Copyright (C) 2016 Denis Mingulov.
hjk's avatar
hjk committed
334

Eike Ziller's avatar
Eike Ziller committed
335
  Contact: http://www.qt.io
hjk's avatar
hjk committed
336 337 338 339 340 341 342 343 344 345 346 347 348 349

  This file is part of Qt Creator.

  You may use this file under the terms of the BSD license as follows:

  "Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are
  met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in
      the documentation and/or other materials provided with the
      distribution.
Eike Ziller's avatar
Eike Ziller committed
350
    * Neither the name of The Qt Company Ltd and its Subsidiary(-ies) nor
hjk's avatar
hjk committed
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
      the names of its contributors may be used to endorse or promote
      products derived from this software without specific prior written
      permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
366 367 368 369 370 371 372 373 374 375 376 377

### Source Code Pro font

  Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
  with Reserved Font Name 'Source'. All Rights Reserved. Source is a
  trademark of Adobe Systems Incorporated in the United States
  and/or other countries.

  This Font Software is licensed under the SIL Open Font License, Version 1.1.

  The font and license files can be found in QtCreator/src/libs/3rdparty/fonts.