To compile and debug with Qt Creator 3.6.1, you must add and configure these options :
For this, go to : Tools -> Options -> Compiler and Run.
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.
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.
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.
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 :
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.
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.
Windows 2/6/2016
Windows 11/11/2024
Windows 1/22/2021
Windows 11/18/2013
Pinned content
InformatiWeb Pro
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.
No comment