Menu
InformatiWeb
  • Index
  • Courses
  • Tutorials
  • InformatiWeb Pro

Login

Registration Password lost ?
FR
  • IT
    • Articles
    • Backup
    • BIOS
    • Live CD
    • MultiBoot
    • Security
    • Virtualization
    • Web
    • Windows
  • InformatiWeb
  • Tutorials
  • IT
  • Windows
  • Install and configure Qt Creator to develop with QT4

Install and configure Qt Creator to develop with QT4

  • Windows
  • 30 August 2016 at 12:30 UTC
  • Lionel
  • 2/2
Previous page

6. Configure Qt Creator to be able to compile and debug with Qt Creator 3.6.1

To compile and debug with Qt Creator 3.6.1, you must add and configure these options :

  • the debugger to use
  • the compiler to use
  • and Qt dll version to use

For this, go to : Tools -> Options -> Compiler and Run.

6.1. Add the debugger : GNU gdb

To begin, go to the tab "Debuggers" and click "Add".

A new line "GNU gdb" appears.
Select it and click the "Browse" button at the bottom.

Select the "mingw32\bin\gdb.exe" file.

Qt Creator will detect that it is the 32 bit version of the GNU gdb 7.7.0 debugger.

Because Qt Creator show you these information, you can rename your debugger to : GNU gdb 7.7.0 32bit.
Click "Apply" to save changes.

6.2. Add the compiler : MinGW

For that, go in the "Compilers" tab and then, click "Add -> MinGW".

Select the line that appears and click "Browse".
As we already know, we'll add the "MinGW 4.8.2 32bit" compiler.

Select the "mingw32\bin\g++.exe" file.

The compiler is added.
Click "Apply" to save changes.

6.3. Selecting the version of Qt to use for your programs : Qt 4.8.6

To indicate that you want to compile your programs in 4.8.6 version, you must go to the tab "Qt versions" and click on the "Add" button.

Select the "C:\Qt\4.8.6\bin\qmake.exe" file.

Qt Creator will automatically detect that it is Qt 4.8.6 for Desktop.
Leave the default name and click "Apply" to save changes.

6.4. Add and configure a kit

To compile and debug with Qt Creator, you must create a "kit".
In summary, it is a configuration in which you specify which compiler, which debugger, ... use to compile and debug your program.

To do this, go to the "Kits" tab and click "Add".

Then, specify and select this :

  • Name : Desktop MinGW 32bit
  • Comiler : MinGW 4.8.2 32bit
  • Debugger : GNU gdb 7.7.0 32bit
  • Qt version : Qt 4.8.6 (4.8.6)

Finally, select the line "Desktop MinGW 32bit" (if not already the case) and click on "Make Default".

Now, Qt Creator is fully configured to allow you to compile and debug your program easily.

7. Test the configuration

To test our configuration, we will use the "Fancy Browser Example" example included with the 4.8.6 version of Qt.
Note : provided examples depend on versions of Qt OpenSource.

Configure this project by selecting our "Desktop MinGW 32bit" kit.

Click on the "run and debug" icon at the bottom left.

The compilation is made without problem.

Then, the debugging begins.

The program created by Digia is started normally.

If you add a breakpoint in the program (and you restart it if necessary), Qt Creator will pause at the desired location and display debugging information.
Such as variables and their contents ...

If you click on the "next line" icon in the middle bar (3rd icon), Qt Creator will effectively go to the next line.

Now, you can code in Qt 4.8.6 and, for example, continue to enjoy the stability of QtWebKit.

Share this tutorial

Partager
Tweet

To see also

  • Transform exe and win files into an iso file

    Windows 4/22/2013

    Transform exe and win files into an iso file

  • Windows 8 / 8.1 - Check the compatibility of your PC

    Windows 5/3/2021

    Windows 8 / 8.1 - Check the compatibility of your PC

  • Windows XP - Install Windows XP on a SATA hard disk

    Windows 12/25/2012

    Windows XP - Install Windows XP on a SATA hard disk

  • Windows XP - Windows Search - Search engine

    Windows 1/7/2010

    Windows XP - Windows Search - Search engine

Comments

No comment

Share your opinion

Pinned content

  • Useful softwares
  • Our programs
  • Terms and conditions
  • Share your opinion

InformatiWeb Pro

  • Win. Server administration
  • Linux Administration
  • Virtualization

Contact

  • Guest book
  • Technical support
  • Contact

® InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.

Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.