Qt Creator needs a compiler set up to build. Configure a compiler in the kit options

QtQt Creator

Qt Problem Overview


I Have Installed Qt Creator5 with latest binaries. but when i am running any program it is giving me this error.

:-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options.

i have searched the whole internet for answer but its inadequate and not helping. kindly reply the way to get rid of this error.

Qt Solutions


Solution 1 - Qt

i was also having the same problem so what i did is

For linux

sudo apt-get install g++ 
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev

and then closed the qt creator and restarted it and it worked

i do not know which of the above two made it work but it worked !!

For Windows

Below given solution have worked for few people. so it is worth a try.

Delete this file C:\Users\AppData\Roaming\QtProject\qtcreator\toolchains.xml to solve the problem.

Solution 2 - Qt

For me on Windows 7 this was solved by clicking on the arrow icon next to the computer icon on the bottom left of the Qt Creator screen above green arrows and then double clicked a compiler on the list and rebuild the project.

Solution 3 - Qt

*** for windows users only ***

Before continuing to next steps make sure u have downloaded latest version of Qt.

  1. Download and install minGW-64-bit from link: <https://sourceforge.net/projects/mingw-w64/files/latest/download>

  2. Remember The directory to which you install minGW.

  3. Open Qt creator and go to tools -> options -> Build and Run

  4. In Compilers tab Select add -> MinGW ->
    Name: MinGW
    path: Browse for mingw-w64.bat (you will find this file in the directory in which you have installed MinGW).
    ABI: x86 Windows msvc2015 pe 64bit

    Don't forget to apply your edits.

  5. Go to Kit -> add
    Name: GCC
    Device Type: Desktop
    Device: Local PC (Default for desktop)
    Compiler: minGW
    Qt Version: select newest version

    Apply changes and restart qt

While creating new project make sure you use GCC as kit

If it still doesn't works Click computer icon on bottom left above play button -> GCC -> Build


OR

Go to projects (It is in the menu on left hand side) -> Build Steps -> make -> Override minGw31-make.exe -> browse to path in which you have installed minGW/bin\mingw32-make.exe
Do the same for clean steps too


If u Still get any error after these steps try setting Environment Variables

  1. Press Win+Q
  2. Type " Environment variables "
  3. click on " Edit the system environment variables "
  4. System Properties -> Advance -> Environment Variables
  5. Click on path (NOTE : Use These steps very carefully and do not mess with other options)
  6. Click edit
  7. press right arrow to go to end of text
  8. type a semi-colon (if it isn't at the end of it because all the system paths are distinguished by a semi-colon)
  9. paste path "MinGW_installation_directory\bin" (In my case it was "G:\Qt\Tools\mingw32\bin"). Make sure you copy and paste CORRECT path
  10. Click OK and apply the changes.


That should do it !!!

Solution 4 - Qt

user2304430 has it right, I struggled also figure it out. Above the green Run/Debug buttons in the bottom left, there's a computer icon with a pop-out menu. In there, you have to select your kit.

I went in circles for half an hour checking that my kits were set up right in options. But you actually have to select the kit in the Computer Icon -> pop-out menu in the bottom left before it does anything.

Amazingly, the first many Google pages for the error don't show this, you'd think almost all new users run into this.

Solution 5 - Qt

I had a similar issue when developing on my Mac -

I was trying to do desktop development with QT creator 3.3.0 based on QT 5.4.0 (Clang 6.0 (Apple)) on OSX 10.9. After trying to manually modify my kits to use GCC, G++, and CLANG. I finally found this really simple solution:

Delete the xxx.pro.user file and then restart QT Creator. It should then automatically pick up your compilers/environments.

Solution 6 - Qt

Had the same issue on Fedora 22 after installing Qt5.5.

Installing the following packages did the trick:

sudo dnf install gcc-c++
sudo dnf install mesa-libGL-devel

Solution 7 - Qt

When I installed Qt into folder ~/Qt/ and then manually renamed the folder into something other, I had similar problem. When I restored the folder name into the original ~/Qt/ (specified at the Qt installer), the problem has disappeared; all was solved.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVivek SauravView Question on Stackoverflow
Solution 1 - QtSubham TripathiView Answer on Stackoverflow
Solution 2 - QtAllan OjalaView Answer on Stackoverflow
Solution 3 - QtAniView Answer on Stackoverflow
Solution 4 - QtPerView Answer on Stackoverflow
Solution 5 - Qts gView Answer on Stackoverflow
Solution 6 - QtNeaţu Ovidiu GabrielView Answer on Stackoverflow
Solution 7 - QtEugene Gr. PhilippovView Answer on Stackoverflow