Building VC++ Projects without Visual Studio

July 14, 2013

tags: , ,
no comments

Building VC++ projects (.vcxproj) without Visual Studio isn’t as easy as building C# projects. Today a new build machine setup was failed on CL error:

VC++-CL-1073741515

C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(147):
"CL.exe" exited with code -1073741515. C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(297,5): Could not
find WindowsSDKDir variable from the registry. TargetFrameworkVersion or
PlatformToolset may be set to an invalid version number.

Solution

1. Install Windows SDK 7.1 on the build agent.

2. Open C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.props and add to the default PropertyGroup:

<PlatformToolset>Windows7.1SDK</PlatformToolset

It should look similar to:

  <PropertyGroup>
    <TargetExt />
         <PlatformToolset>Windows7.1SDK</PlatformToolset>
  </PropertyGroup>

3. The last step is making the required files available for the VC++ compiler. Copy the following files to anywhere on the build agent ( ‘%CommonProgramFiles(x86)%\Microsoft Shared\VC’ might be an idea) and add the directory to the build agent’s Path system environment variable (%windir%\system32\SystemPropertiesAdvanced.exe).

For Visual Studio 2012 (PlatformToolset=v110):

%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\Common7\IDE\

msobj110.dll

mspdb110.dll

mspdbcore.dll

mspdbsrv.exe

For Visual Studio 2010 (PlatformToolset =v100):

%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\

msobj100.dll

mspdb100.dll

mspdbcore.dll

mspdbsrv.exe

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*