Att: Qt Engineers - No Visual Studio for Qt
I have tried to get Qt Creator/Qt 5.2.1 to run with Visual Studio 20-12/13 and Windows SDK combo, but to no avail. Qt Crator seems to be unable to locate the CL compiler. Please follow this "link.":http://qt-project.org/forums/viewthread/39085/P15/#167168
But this is not a simple glitch, this is a pattern, see the bug report 11539 "here":https://bugreports.qt-project.org/browse/QTCREATORBUG-11539. In trying to solve this problem, I have also tried the same solution suggested in the above mentioned bug report, but I have found another issue with in the solution, an issue that might lead to the permanent solution to this bug.
Here is my attempt to run Qt Creator from a batch:
@call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
REM start C:\Qt64\Tools\QtCreator\bin\qtcreator.exe@
When line 2 is executed, vcvarsall.bat runs calling the this line:
@if /i %1 == x86_amd64 goto x86_amd64@
which in turn calls this line:
if not exist "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat" goto missing
This will run the vcvarsx86.bat which when executing this
@if "%VS120COMNTOOLS%"=="" goto error_no_VS120COMNTOOLSDIR
@call "%VS120COMNTOOLS%VCVarsQueryRegistry.bat" 32bit 64bit@
it goes to this line:
@echo ERROR: Cannot determine the location of the VS Common Tools folder.
and graciously displays the error message on the console.
Why would MS' batch files not be able to work as it a MS created file after all?
Can any of you shed some light into this solution?
I would love it if a person directly involved in the deployment of Qt to MS Windows get involved in this solution.
Thanks in advance
this problem with MS' batch files has nothing to do with Qt, i.e. it usually occurs because the environment variables are not set properly when you installed Visual Studio 2013 (or because you uninstalled it).
Start a CMD (an ordinary one, not the Developer Command Prompt) and type "set" to see if VS120COMNTOOLS is in there. If it's not, you can repair it.
Humm... It is not just an MS' problem when you think of it, if the MS' batch file is having problems finding VS120COMNTOOLS , it just might be that Qt Creator is having the same problem?
On the other hand, I followed your suggestion regarding the set tool, this is what I got from it:
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
DXSDK_DIR=C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)
Path=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\WindowsPowerShell\v1.0;D:\Program Files\SQLiteViewer\SQLite Database Browser 2.0 b1.exe;C:\Program Files (x86)\Graphviz2.30\bin;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
ProgramFiles(x86)=C:\Program Files (x86)
VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools
*VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools*
XNAGSv4=C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0
I hope the information presented would be enough to solve this riddle.
Ok, your environment seems fine, so it could be this error due to you previously installed Visual Studio 2013 on your D: drive and then C:, or something like that :-)
Anyway, what I mean, the error in this case is probably in your registry, open regedit and check that the following key is correct:
to the right it should say: 12.0 REG_SZ C:\Program Files (x86)\Microsoft Visual Studio 12.0
(not D: or something like that!)
Thank you so very much for your help. It is true, a long time ago I installed Visual Studio(s) in the D:, later on I remove them from there to reinstall'em in the C:. I did as you suggested, but the "registry ":https://onedrive.live.com/?cid=8f8db1a4f405473f#cid=8F8DB1A4F405473F&id=8F8DB1A4F405473F!136 seems to be OK.
This is one pesky problem, but I am not the first one to have it and many others have not resolved it, but I am confident that one day a solution will be reached, be it provided from Qt or the combined effort of all participants of this forum; I will keep posting, so please keep the effort to reaching a solution. After all, if we cannot find it here, who else would?
I would like to have this discussion and its resolution recorded for future programmers facing the same predicament.
Hi, indeed if you google you can see others also have this problem.
I checked the script again in vcvarsx86_amd64.bat.
Ok, your registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7 is good, but can you also check for two others if they exist?
If they exist, they could block the script from seeing the correct one.