Mounty
Mounty

Reputation: 331

QMAKE_MSC_VER isn't set

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?

Upvotes: 33

Views: 21835

Answers (5)

BuvinJ
BuvinJ

Reputation: 11086

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

Upvotes: 0

Top-Master
Top-Master

Reputation: 8826

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)
    

Upvotes: 0

user10838321
user10838321

Reputation:

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).

Upvotes: 2

adam.baker
adam.baker

Reputation: 1485

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.)

Upvotes: 5

pdx_interactives
pdx_interactives

Reputation: 668

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.

Upvotes: 54

Related Questions