How to set up the compiler and debugger in QtCreator
Solution 1
In general, you seem to lack the compiler and proper "kit" installation. Try to install msvc or mingw with the corresponding Qt installer, and then double check the kit settings.
If the auto-detection does not work out afterwards, you can always add a kit explicitly:
Select Tools > Options > Build & Run > Kits > Add.
You can find a screenshot below from my machine where you should look for that. Note that the screenshot was taken on my Linux box, but the place for the configuration should be unified on the UI.
See the documentation for further details:
Solution 2
You need to install a compiler, you gave no operating system details I will assume you are a windows user.
http://www.wikihow.com/Install-Qt-SDK-on-Microsoft-Windows
So far you only have the IDE, you need the compiler, you can install several different ones.
Related videos on Youtube
user3168129
Updated on September 15, 2022Comments
-
user3168129 over 1 year
In Qt for C++ , how do I setup a compiler and debugger in Windows for running a console application? It gave me this error when I try to debug an application :-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options.
-
László Papp over 10 yearsActually, the OP did write Windows.
-
László Papp over 10 yearsI am not sure how you are trying to address the issue. The OP has problems with the compiler set up properly in QtCreator. There is no need to disable anything AFAICT. I am not sure what redirection you are writing about either. Also, you modified the title into a debugging issue whereas it is also a generic compiler issue as it seems. I rolled your edit back, and tried to clarify with a new revision. Hope, it is now what the OP wants.
-
Marek R over 10 yearsNote that he wrote about debugging CONSOLE application! So I assume that standard UI application works for him perfectly. There is some issue with GDB and console standard input and I'm sure this is his problem, not installing and configuring Qt environment!
-
László Papp over 10 yearsI am not sure where you got the information from that the "UI application works for him perfectly.". It is possible the OP has not even tried because he just wanted to get something quick up and console was preferred.
-
Marek R over 10 yearsok you are right, maybe I should drink some coffee at the morning :)