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

前端 未结 7 1937
花落未央
花落未央 2020-12-03 00:28

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

相关标签:
7条回答
  • 2020-12-03 01:05

    * 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 !!!

    0 讨论(0)
  • 2020-12-03 01:07

    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.

    0 讨论(0)
  • 2020-12-03 01:08

    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.

    0 讨论(0)
  • 2020-12-03 01:10

    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.

    0 讨论(0)
  • 2020-12-03 01:15

    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.

    0 讨论(0)
  • 2020-12-03 01:16

    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.

    0 讨论(0)
提交回复
热议问题