28

After I changed my Qt Version from 5.5.1 to 5.12.0 I get following message while I try to build any project:

msvc-version.conf loaded but QMAKE_MSC_VER isn't set

I selected the Qt 5.12.0 MSVC2017 32bit Kit instead of the Qt 5.5.1 (msvc 2013) Kit.

Does anybody know the reason for this message and could explain me how I should fix it?

Philipp Palmtag
  • 1,310
  • 2
  • 16
  • 18
Mounty
  • 281
  • 1
  • 3
  • 4

5 Answers5

50

Try removing any .qmake.stash files in your projects. This fixed this same issue for me when building QT from source after previously building with a different target.

  • take note that the stash file is invisible. that took me some time to figure out. deleting it worked. – David M. Cotter Sep 06 '20 at 20:11
  • 1
    if removing .qmake.stash didn't work (that was the case when I tried it), try running `qmake` with the option `-nocache`. – Roman Schaub Oct 30 '20 at 07:18
  • I just ran into this AGAIN, googled, found this answer AGAIN, and saw my own note above. This time, i found the invisible .qmake.stash file TWO LEVELS UP from my project file??!? – David M. Cotter May 22 '21 at 00:19
4

I ran into this error message after returning to a project I hadn't worked on in a year. I solved it by deleting the project's .pro.user file. (It seems to have been looking for a build kit I had gotten rid of at some point in the year.)

adam.baker
  • 1,447
  • 1
  • 14
  • 30
2

Open msvc-version.conf (in my case in C:\Qt\Qt5.12.8\5.12.8\msvc2017_64\mkspecs\common)

add

QMAKE_MSC_VER = 1929

at the beginning (for VS2019).

0

In older Qt versions, like Qt 5.6, which is last version that allows v2.1 of LGPL license.

Such thing as QMAKE_MSC_VER does not exist.

Simply create it, like:

  • Open mkspecs/common/msvc-desktop.conf file (from to Qt-sources) in editor.
  • Find:
    unset(MSC_VER)
    
  • Replace it with below and done:
    QMAKE_MSC_VER = $$MSC_VER
    unset(MSC_VER)
    
Top-Master
  • 7,611
  • 5
  • 39
  • 71
0

If your intended compiler isn't MSVC to begin with, but rather MinGW, be sure you have the correct project configuration selected! :)

BuvinJ
  • 10,221
  • 5
  • 83
  • 96