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

Link error of _MSC_VER mismatch after build Qt 4.8.4 specifically for VS2012



  • I followed http://stackoverflow.com/questions/12113400/compiling-qt-4-8-x-for-visual-studio-2012/14928303#14928303 to build Qt 4.8.4 specifically for VS2012, but got link error: qtmaind.lib(qtmain_win.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in main.obj

    I checked configure.cache under my qt folder, it is showing: -platform win32-msvc2012

    Does anybody know what is wrong here? Thanks



  • You probably linked it to the wrong library(.dll/.lib) or objects(.obj) compiled with older versions of Visual Studio (VS2010, VS2008, etc).



  • I tried two options:

    1. use command
      configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2012

    and 2) Go to mkspecs\win32-msvc2010. Open qmake.conf and change:
    QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
    to:
    QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
    then use command configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2010

    both gave me the same error. I can not see any wrong configuration in my build...


Log in to reply