Does QT actually call VCVARSALL.BAT?
Environment: VStudio Express 2012, Qt 5.x, Windows 7 64 Home premium
Issue: I have to manually call VCVARSALL.BAT before Qt or it doesn't find cl.exe.
Having checked compiler settings, it looks like everything is well detected. So I come to the conclusion that VCVARSALL.BAT is not called by QT during initialization.
Is that a bug? I see many people reporting this "missing cl.exe" issue and looks like no clear action or root cause was identified so far.
When on Windows, I usually use VisualStudio's cmd and add Qt stuff to PATH. Works well.
[quote author="sierdzio" date="1378560342"]When on Windows, I usually use VisualStudio's cmd and add Qt stuff to PATH. Works well.[/quote]
I am using Qt Creator as a main editor, not Visual Studio. This used to be very simple and effective with Qt4. Now something is broken since Qt5 and Digia.
To check if Qt Creator correctly initializes MSVC, see Tools -> Options -> Build & Run -> Compilers
!http://i.imgur.com/6x53fV8.png(vcvarsall.bat in Qt Creator 4.8.1)!
Check the build environment in projects mode/Kit-name/Build. Does it contain everything you need? It should have everything from vcvarswhatever.bat.
If it does not, then please file a bug report and add whatever is missing as a work around.
I observe the same problem. My configuration is the latest Qt 5.2.0 + Qt Creator 3.0.0, Visual Studio 2012 Express, Windows SDK For Windows 8.1, Windows 8.1 64bit.
I installed everything on clean machine in the following order:
- Windows SDK (http://msdn.microsoft.com/en-US/windows/desktop/bg162891)
- Visual Studio 2012 Express (http://www.microsoft.com/en-us/download/details.aspx?id=34673)
- Qt has been installed with the Qt Online Installer for Windows (http://download.qt-project.org/official_releases/online_installers/1.5/qt-windows-opensource-1.5.0-x86-online.exe)
As the result I got
But when add the Qt 5.2.0 MSVC2012 32 bit kit to my project, building environment contains nothing related to Visual Studio 2012 compiler (INCLUDE, PATH, LIB and so on)
Thank in advance.
Very strange. I don't know what's going on, but this user seems to have found a way around the issue: http://qt-project.org/forums/viewreply/163521/
Yes , this is workaround but this is not solution. Imagine that I can have both 2010 and 2012 studio (actually it is so). In that case I have to restart the qt creator switching between 2010 and 2012.
Remark that this applies to express versions. On my work machine (windows 7 pro + visual studio 2010 pro + qt 5.2.1) there is no such problem.
If you're willing, please post a bug report at https://bugreports.qt-project.org/ and attach your screenshots.
This might help the Qt Creator team find a proper solution.
I don't think the problem is with Express -- I use MSVC 2012 and MSVC 2013 Express with Qt Creator, with no issues.
I have reported here https://bugreports.qt-project.org/browse/QTCREATORBUG-11539
Thank you for your time JKSH!
[quote author="JKSH" date="1393035362"]
I don't think the problem is with Express -- I use MSVC 2012 and MSVC 2013 Express with Qt Creator, with no issues.[/quote]
I found one moment that may became cause of the problem. This is profile name. On my work machine I have latin profile name
APPDATA=C:\Users\Stranger\AppData\Roaming, but on home machine there is cyrillic profile name:
Great; thank you for your report! I hope it can help fix this issue.
Hi :) Found this post while searching for "'cl' is not recognized as an internal or external command". I got this message in Qt Creator building a project with Qt 4.8.5 and MSVC 2010. Strange thing since it worked earlier today.
I found the reason and solution for me: an application I had installed in the mean time (between working and non working compiling in Creator) had wiped out my System PATH variable. Luckily I was able to recover it using this post on SuperUser: http://superuser.com/a/265575
Might not be relevant for the original posters problem, but others may end up here like me searching for the same problem. :)
Daniel Teske has found workaround: https://bugreports.qt-project.org/browse/QTCREATORBUG-11539
You should redirect TMP to path without non-latin non-space characters. For example TMP=c:\tmp works fine.
Hey. This topic ranks high in Google searches for similar problem, so I'm adding that users of Qt 5.7.0 / MSVC2015 might hit what looks like a QTCreator bug, where QTCreator incorrectly runs VC's initialization script. See QTCREATORBUG-16397 - MSVC2015 builds fail due to calling architecture-specific vcvars with architecture parameter.
I have experienced same thing. All environment variables related with VC was not set automatically when QtCreator launched. I solved the issue by changing Windows account name. If the account name has some special characters(like "&"), it seems the environment values are not parsed properly during invoking vcvar.
@DY-Kim I would avoid using such user names as user names are part of paths like c:\users\USER_NAME
If a user name contains characters which have special meaning for the CMD/shell then you can expect troubles like what you described.