Qt Creator Compiler Config Issue

对着背影说爱祢 提交于 2019-12-10 21:44:25

问题


I have just started to learn C++ and have come across Qt Creator. I have installed it alongside the built in MinGW Compiler. However I cannot get my projects to 'Build and Run'. I have attached some screenshots below, thank you for any help!

The last image shows the two auto-detected kits which I can choose from. I tried creating my own kit and linked it with the compiler since the auto-detected kits don't have the compiler linked to it.

Also, the following error shows when I try to 'Build and Run' my project :

18:02:25: Configuration is faulty. Check the Issues view for details. Error while building/deploying project Test (kit: Desktop Qt 5.6.0 MSVC2015 64bit) When executing step "Make"


回答1:


Dry facts:

  • You've installed Qt distributions (libraries, include files, etc.) of versions 5.6 and 5.7 built to use with Visual Studio C++ 2015 compiler.
  • You don't have Visual Studio 2015 C++ compiler (or it is not properly set up)
  • You've installed MinGW 4.9.2, which is a windows port of GCC compiler.
  • You haven't installed Qt for MinGW

Problem:

  • Due to a lack of binary compatibility between C++ compilers, Qt distributions (same as any other libraries) built with one compiler cannot be linked with code compiled with another compiler. QtCreator knows this and warns you.

Possible solutions:

  • Install Qt for MinGW (with maintenancetool.exe in Qt folder)
  • Install Visual Studio 2015 (make sure you check "C++ tools" during installation)
  • Install both
  • Install other matching pairs of { compiler, Qt_distribution }

    (in last two cases you can easily swap between toolchains)

Make sure you roll back any damage you've made to compiler settings in QtCreator.

See also: Installing Qt 5.6: Which components should I choose?



来源:https://stackoverflow.com/questions/37685474/qt-creator-compiler-config-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!