Solved :-1: error: Failed to retrieve MSVC Environment from "E:\Programs\Microsoft Visual Studio 9.0\VC\vcvarsall.bat x86": \Microsoft was unexpected at this time.
-
:-1: error: Failed to retrieve MSVC Environment from "E:\Programs\Microsoft Visual Studio 9.0\VC\vcvarsall.bat x86":
\Microsoft was unexpected at this time.I have just today downloaded Qt 5.13.0. Qt Creator information:
// ========================
Qt Creator 4.9.2
Based on Qt 5.12.4 (MSVC 2017, 32 bit)Built on Jun 26 2019 11:28:42
From revision 8181363fa9
// ========================I see many similar errors on the forum, but this appears simply to be a problem with missing quotes around the path (“\Microsoft was unexpected at this time.”)
But where did it get this path? The path itself is entirely valid. The BAT file is at that location and nothing is misspelled. It seems only to be an issue with the fact that there are spaces in the path.So where do I go to correct this? This is not in my PATH environment variable.
L. Spiro
-
@l-spiro Hi and welcome!
Visual Studio 9.0 is version 2008 (https://en.wikipedia.org/wiki/Microsoft_Visual_Studio). I really doubt Qt 5.13 will work with such an old version. You should use either 2015 or 2017 and download Qt 5.13 for that exact version.
-
I already have Visual Studio 2015 etc.
Where do I go to change this path so that it finds the correct version?L. Spiro
-
@l-spiro If you're using QtCreator then go to "Tools/Options/Kits" and check the Kits you have there. Do you have one with Visual Studio 2015 C++ compiler there? In the bottom left side in QtCreator you can select the Kit you want to use, make sure Visual Studio 2015 Kit is selected.
Which exact Qt 5.13 version did you install (for which compiler)? -
It shows “Desktop Qt 5.13.0 MSVS2015 64bit (default)” there.
This aligns with the version I downloaded and installed, and I see nothing wrong with the paths there.
The C++ compiler set there is “Microsoft Visual C++ Compiler 14.0 (amd” (this is all I can read because the combo box is too small).L. Spiro
-
@l-spiro From my experience, the MSVC compiler detection only works correctly if MSVC is installed in the default location. Is there a reason you installed it on drive E: ?
-
@aha_1980 Hard drive space.
L. Spiro
-
@l-spiro Ok, I understand.
Nevertheless, when using non-standard layouts, you're on your own when things go wrong.
But where did it get this path? The path itself is entirely valid. The BAT file is at that location and nothing is misspelled. It seems only to be an issue with the fact that there are spaces in the path.
The path is taken from the registry, IIRC.
L. Spiro about 4 hours ago
:-1: error: Failed to retrieve MSVC Environment from "E:\Programs\Microsoft Visual Studio 9.0\VC\vcvarsall.bat x86":
\Microsoft was unexpected at this time.When resp. where does this message appear exactly?
What you can also try is to use Creator 4.10: https://blog.qt.io/blog/2019/08/02/qt-creator-4-10-rc-released
I think this version allows you to select arbitrary
vcvars.bat
, but I'm not sure.Regards
-
It appears there.I intend to code in Visual Studio and use Creator sparingly, and this is just a sample. Do I need to worry about this error?
L. Spiro
-
@l-spiro said in :-1: error: Failed to retrieve MSVC Environment from "E:\Programs\Microsoft Visual Studio 9.0\VC\vcvarsall.bat x86": \Microsoft was unexpected at this time.:
I intend to code in Visual Studio and use Creator sparingly, and this is just a sample. Do I need to worry about this error?
Well, it means you cannot use this compiler. Does the MSVC 2015 compiler work in Creator? Can you show Tools > Options > Kits > Compilers?
-
All installations of Visual Studio are on E:\ and should be expected to have this same issue.L. Spiro
-
@l-spiro Can you show the kit you're using? Did you really configure 2015 compiler there?
-
@l-spiro said in :-1: error: Failed to retrieve MSVC Environment from "E:\Programs\Microsoft Visual Studio 9.0\VC\vcvarsall.bat x86": \Microsoft was unexpected at this time.:
Hard drive space.
As a workaround, try to use mklink to create a Directory Symbolic Link or a Directory Junction. Make
C:\Program Files (x86)\Microsoft Visual Studio 9.0\
point toE:\Programs\Microsoft Visual Studio 9.0\
(assuming you have 64-bit Windows). This will make your system think that Visual Studio is available in the C: drive.https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink
-
This was all configured automatically. And since the 2015 Visual Studio version is what I selected, it seems this is all correct.I can try the symbolic link later today after sleeping.
L. Spiro