Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem building .pro file in QtCreator
Forum Update on Monday, May 27th 2025

Problem building .pro file in QtCreator

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Perdrix
    wrote on 1 May 2020, 18:11 last edited by Perdrix 5 Jan 2020, 18:13
    #1

    :-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

    1 Reply Last reply
    1
    • C Online
      C Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on 1 May 2020, 18:51 last edited by Chris Kawa
      #2

      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.

      1 Reply Last reply
      4
      • P Offline
        P Offline
        Perdrix
        wrote on 2 May 2020, 16:33 last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0

        1/3

        1 May 2020, 18:11

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved