Page 1 of 1

Having trouble initializing vc2008 build environment.

Posted: Sat May 21, 2016 12:13 am
by ggodw000
Here is my path environment variable under windows:

Code: Select all

%SystemRoot%\system32;
%SystemRoot%;
%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
C:\OpenSSL-Win32\bin;C:\Python27\;
"C:\Program Files (x86)\Git\cmd";
"c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\";
"C:\Program Files (x86)\GnuWin32\bin";
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Vc\bin\";
"C:\Program Files\SlikSvn\bin";
"C:\MyWorkSpace\BaseTools\Bin\Win32"
Any path with space is enclosed in double parenthesis. But when i initialize the VC2008 build environment by launching vcvarsall.bat, it is throwing following error message:

Code: Select all

\Git\cmd";"c:\Program was unexpected at this time.
I am not sure if this is causing the build to fail, but definitely, something is not working. I traced down to very point where it fails:
it is in c

Code: Select all

:\program files (x86)\visual studio 9.0\vc\bin\amd64\vcvarsamd64.bat
Inside this file, following causes it to fail:

Code: Select all

PATH=%WindowsSdkDir%bin\x64;%WindowsSdkDir%bin\win64\x64;%WindowsSdkDir%bin;%PATH%

It looks like it is trying to append the path, and is not liking the part that contain git.
suspecting it might not be liking the double quote (although i usually have seen it is the other way around), i removed all double quotes and makes no difference. I am lost here.

But then, If I do that line causing the error message manually from DOS prompt directly, it works, it is just if it is executed from batch file it then throws that error. I am lost.

Code: Select all

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>echo %PATH%
C:\Windows\system32;C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\OpenSSL-Win32\bin;
C:\Python27\;
"C:\Program Files (x86)\Git\cmd";
"c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\";
"C:\Program Files (x86)\GnuWin32\bin";
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Vc\bin\";
"C:\Program Files\SlikSvn\bin";
"C:\MyWorkSpace\BaseTools\Bin\Win32";
C:\Program Files (x86)\Git\cmd;
c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files (x86)\GnuWin32\bin;
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Vc\bin\;
C:\Program Files\SlikSvn\bin;
C:\MyWorkSpace\BaseTools\Bin\Win32

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>echo %WindowsSdkDir%
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>PATH=%WindowsSdkDir%;%PATH%

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>echo %PATH%
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\OpenSSL-Win32\bin;
C:\Python27\;
"C:\Program Files (x86)\Git\cmd";
"c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\";
"C:\Program Files (x86)\GnuWin32\bin";"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Vc\bin\";
"C:\Program Files\SlikSvn\bin";
"C:\MyWorkSpace\BaseTools\Bin\Win32";
C:\Program Files(x86)\Git\cmd;
c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Vc\bin\;C:\Program Files\SlikSvn\bin;
C:\MyWorkSpace\BaseTools\Bin\Win32

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>PATH=%WindowsSdkDir%bin\x64;%WindowsSdkDir%bin\win64\x64;%Win
dowsSdkDir%bin;%PATH%

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>echo %PATH%
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\bin\x64;
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\bin\win64\x64
;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\bin;
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\;C:\Windows\syst
em32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\OpenSSL-Win32\bin;
C:\Python27\;
"C:\Program Files (x86)\Git\cmd";
"c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\";
"C:\Program Files (x86)\GnuWin32\bin";
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Vc\bin\";
"C:\Program Files\SlikSvn\bin";
"C:\MyWorkSpace\BaseTools\Bin\Win32";
C:\Program Files (x86)\Git\cmd;
c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files (x86)\GnuWin32\bin;
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Vc\bin\;
C:\Program Files\SlikSvn\bin;C:\MyWorkSpace\BaseTools\Bin\Win32

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>

Re: Having trouble initializing vc2008 build environment.

Posted: Sat May 21, 2016 12:34 pm
by jnc100
This seems relevant.

Regards,
John.

Re: Having trouble initializing vc2008 build environment.

Posted: Sat May 21, 2016 2:13 pm
by ~
You could add the paths one by one.

Also, instead of using automatic system PATH variables and the like, you could add the precise directories you want and remove the rest, after taking note of your original configuration, of course.

Start by the ones you suspect that are giving you trouble and find a way to fix or rename them.

Then you can easily find the problems gradually, individually.