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

前端 未结 7 1936
花落未央
花落未央 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 !!!

提交回复
热议问题