Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem building .pro file in QtCreator



  • :-1: warning: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" is used by qmake, but "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe" is configured in the kit.
    Please update your kit (Desktop Qt 5.12.8 MSVC2015 64bit) or choose a mkspec for qmake that matches your target environment better.

    What is this trying to tell me and how do I fix it please?

    I'm also getting message like:

    D:\qt-book\chap10\settingsviewer\main.cpp:1: error: C1083: Cannot open include file: 'QApplication': No such file or directory

    when I try to build, even though I have added: C:\Qt\5.12.8\msvc2017_64\include to the include path in C++ settings ...

    Thanks
    David


  • Moderators

    There are actually 4 MSVC compilers for the desktop. There is a 32bit executable and 64 bit. Both of those can produce 32bit and 64bit binaries. The path in that warning indicates which combination you are using, so for example ...\HostX86\x64\cl.exe means you are using 32bit compiler that produces 64bit binaries and ...\HostX64\x64\cl.exe means you are using 64bit compiler that produces 64bit binaries.

    The warning says that you have a Qt build (which is where qmake comes from) that was created using 32bit compiler (HostX86) and your kit is set up to build your app using the 64bit one. This is harmless because they both produce the same binaries but if you want to get rid of it you can switch your kit to use the 32bit compiler. Do that by going to Tools->Options->Kits, select your kit and change the C++ compiler to appropriate one. Note that Microsoft's naming is inconsistent even in the same product so while the directories in that path are named X86 and x64 the equivalent compiler names for those are x86 and amd64, so the compiler under ...\HostX86\x64\cl.exe will be listed here as x86_amd64.

    As for your other question - don't add any paths like that. This would add MSVC paths to all possible kits you set up which is not what you want. MSVC include paths are added automatically as part of the toolchain set up in the kit so you don't need to add anything manually. Also, this error is not about missing includes from MSVC, but from Qt. Each Qt include is associated with certain Qt module. In this case you have missing QApplication which is in the widgets module (see docs). To use that module you need to have it added in your .pro file like this: QT += widgets. After you modify the .pro file to include it don't forget to run Build -> Run qmake to make sure changes are picked up.


  • Moderators

    There are actually 4 MSVC compilers for the desktop. There is a 32bit executable and 64 bit. Both of those can produce 32bit and 64bit binaries. The path in that warning indicates which combination you are using, so for example ...\HostX86\x64\cl.exe means you are using 32bit compiler that produces 64bit binaries and ...\HostX64\x64\cl.exe means you are using 64bit compiler that produces 64bit binaries.

    The warning says that you have a Qt build (which is where qmake comes from) that was created using 32bit compiler (HostX86) and your kit is set up to build your app using the 64bit one. This is harmless because they both produce the same binaries but if you want to get rid of it you can switch your kit to use the 32bit compiler. Do that by going to Tools->Options->Kits, select your kit and change the C++ compiler to appropriate one. Note that Microsoft's naming is inconsistent even in the same product so while the directories in that path are named X86 and x64 the equivalent compiler names for those are x86 and amd64, so the compiler under ...\HostX86\x64\cl.exe will be listed here as x86_amd64.

    As for your other question - don't add any paths like that. This would add MSVC paths to all possible kits you set up which is not what you want. MSVC include paths are added automatically as part of the toolchain set up in the kit so you don't need to add anything manually. Also, this error is not about missing includes from MSVC, but from Qt. Each Qt include is associated with certain Qt module. In this case you have missing QApplication which is in the widgets module (see docs). To use that module you need to have it added in your .pro file like this: QT += widgets. After you modify the .pro file to include it don't forget to run Build -> Run qmake to make sure changes are picked up.



  • This post is deleted!

Log in to reply