Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-16397

MSVC2015 builds fail due to calling architecture-specific vcvars with architecture parameter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 4.0.1
    • Qt Creator 4.0.0
    • 6863acfe9184a2d30c94fa079fed1bc1e30d40db

    Description

      Steps to reproduce:

      1. Using the below-described environment,
      2. Create the simplest application from the "Qt Console Application" template.
      3. Build it

      Expected: application builds

      Actual:

      10:59:54: Running steps for project testconsole...
      10:59:54: Starting: "C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin\qmake.exe" C:\Users\cadens\Documents\testconsole\testconsole.pro -r -spec win32-msvc2015 "CONFIG+=debug" "CONFIG+=qml_debug"
      10:59:54: The process "C:\Qt\Qt5.7.0\5.7\msvc2015_64\bin\qmake.exe" exited normally.
      10:59:54: Starting: "C:\Qt\Qt5.7.0\Tools\QtCreator\bin\jom.exe" 
      	C:\Qt\Qt5.7.0\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
      	cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -EHsc /Fddebug\testconsole.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_CORE_LIB -I..\testconsole -I. -I..\..\..\..\Qt\Qt5.7.0\5.7\msvc2015_64\include -I..\..\..\..\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtCore -Idebug -I..\..\..\..\Qt\Qt5.7.0\5.7\msvc2015_64\mkspecs\win32-msvc2015 -Fodebug\ @C:\Users\cadens\AppData\Local\Temp\main.obj.4996.0.jom
      'cl' is not recognized as an internal or external command,
      operable program or batch file.
      jom: C:\Users\cadens\Documents\build-testconsole-Desktop_Qt_5_7_0_MSVC2015_64bit-Debug\Makefile.Debug [debug\main.obj] Error 1
      jom: C:\Users\cadens\Documents\build-testconsole-Desktop_Qt_5_7_0_MSVC2015_64bit-Debug\Makefile [debug] Error 2
      10:59:54: The process "C:\Qt\Qt5.7.0\Tools\QtCreator\bin\jom.exe" exited with code 2.
      Error while building/deploying project testconsole (kit: Desktop Qt 5.7.0 MSVC2015_64bit)
      When executing step "Make"
      10:59:54: Elapsed time: 00:00.
      

      Obviously, QTCreator did not run VC's environment variables initialization script. Let's confirm this:

      1. Open Command Prompt and run:
        C:\Users\cadens>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
        C:\Users\cadens>C:\Qt\Qt5.7.0\Tools\QtCreator\bin\qtcreator.exe
        
      2. From QTCreator, Build the project.
      3. Success!
        11:02:43: Running steps for project testconsole...
        11:02:43: Configuration unchanged, skipping qmake step.
        11:02:43: Starting: "C:\Qt\Qt5.7.0\Tools\QtCreator\bin\jom.exe" 
        	C:\Qt\Qt5.7.0\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
        	cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -EHsc /Fddebug\testconsole.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_CORE_LIB -I..\testconsole -I. -I..\..\..\..\Qt\Qt5.7.0\5.7\msvc2015_64\include -I..\..\..\..\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtCore -Idebug -I..\..\..\..\Qt\Qt5.7.0\5.7\msvc2015_64\mkspecs\win32-msvc2015 -Fodebug\ @C:\Users\cadens\AppData\Local\Temp\main.obj.4856.16.jom
        main.cpp
        	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\testconsole.exe @C:\Users\cadens\AppData\Local\Temp\testconsole.exe.4856.936.jom
        11:02:45: The process "C:\Qt\Qt5.7.0\Tools\QtCreator\bin\jom.exe" exited normally.
        11:02:45: Elapsed time: 00:01.
        

      So QTCreator fails to run, or incorrectly runs this initialization script. Let's see what it pretends to run in Tools / Options / Build & Run / Microsoft Visual C++ Compiler 14.0 (amd64):

      Initialization: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat amd64
      

      Alright, let's run this from a command prompt:

      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" amd64
      
      Error in script usage. The correct usage is:
      
          "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
      
        or
      
          "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" store
      
        or
      
          "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" 10.0.10240.0
      
        or
      
          "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" store 10.0.10240.0
      

      There's the problem, QTCreator runs the already-architecture-specific script with the "amd64" architecture parameter, which melts the script down.

      → QTCreator should either call:

      "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"

      or

      "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

      but certainly not

      "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" amd64
      

      Extra mile: if this is recognized as a bug and work is done do address it, would it make sense to by the way give visibility of QTCreator running VC's init script? While trying to understand what was going on, I would have loved a little line in the Compile Output tab that would have said something like:

      Trying to run initialization line for compiler MSVC2015_x64:
      "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" amd64
      

      What do you think about that?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              hunger Tobias Hunger
              ronjouch Ronan Jouchet
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes