Qt Creator needs a compiler set up to build. Confi

2019-01-11 02:33发布

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 qt-creator
7条回答
2楼-- · 2019-01-11 02:49

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.

查看更多
女痞
3楼-- · 2019-01-11 02:49

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.

查看更多
The star\"
4楼-- · 2019-01-11 02:55

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.

查看更多
疯言疯语
5楼-- · 2019-01-11 02:56

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.

查看更多
Summer. ? 凉城
6楼-- · 2019-01-11 03:00

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
查看更多
劫难
7楼-- · 2019-01-11 03:08

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

查看更多
登录 后发表回答