Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013: CL.exe exited with code -1073741515

I have a fresh Windows 8.1 Pro x64 install with a fresh Visual Studio 2013 Pro. When trying to compile a project with Platform Toolset to Windows7.1SDK I'm getting

Error   1   error MSB6006: "CL.exe" exited with code -1073741515.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets   57  5   MenuBrowser

I tried running the supplied "Windows SDK Configuration Tool" and besides getting an error about Visual Studio 2005 and 2008 not being installed I think it did its job.

I tried manually editing the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows

where I manually put CurrentInstallFolder as C:\Program Files\Microsoft SDKs\Windows\v7.1\ and CurrentVersion as 7.1.7600.0.30514. If I look at the project properties and click the different paths / variables in there -> more -> Macros, I can see that $(WindowsSdkDir) is correct.

Any idea as to what I should try? Never ran into this problem on the old development computer with Windows 7 and VS 2012.

L.E. as a note, if I try a new project with the v120 tools, it works, but I need the Windows7.1SDK tools.

like image 564
foxx1337 Avatar asked Feb 26 '14 10:02

foxx1337


2 Answers

When trying to compile a project with Platform Toolset to Windows7.1SDK...

That's not a valid selection in a "fresh" install for VS2013. Not very clear what you've been doing, it certainly isn't "fresh" anymore. Do treat Regedit.exe as a loaded weapon, the registry key set that configures VS has been getting pretty doggone convoluted as of late.

The compiler crashes with -1073741515 == 0xC0000135 == STATUS_DLL_NOT_FOUND. That's a pretty serious mishap of course, it should never occur when you target SDK 7.1 since that still uses the same compiler, only the SDK directory is changed. The compiler itself, as well as the DLLs it uses, are not part of the SDK and only are provided if the machine doesn't have VS installed. You can use SysInternals' Process Monitor to diagnose this, you'll see the CL.EXE process searching for a DLL and not finding it.

The correct way to target 7.1 is to use the v120_xp toolset selection. That builds programs that can still run on XP, it automatically also selects the 7.1A SDK that was installed on your machine. Do try to undo the changes you've made.

like image 77
Hans Passant Avatar answered Nov 11 '22 21:11

Hans Passant


Referencing Yodans solution from How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?:

As pointed out by Hans Passant cl.exe looks for mspdb100.dll (among others) and does not find them. The needed files are in the directory mentioned in 7. below:

My working setup:

  1. VS2013 needs to use VS2010 libs
  2. Using WinSDK 7.1 build tools (v100) in VS2013
  3. clean install, uninstalling everything mentioned in the sdk release notes (can be downloaded at http://www.microsoft.com/en-us/download/details.aspx?id=8279 under category Details)
    1. Microsoft Windows SDK for Windows 7 (7.1) (the Windows SDK core-component files)
    2. Application Verifier
    3. Debugging Tools for Windows
    4. Windows Performance Toolkit
    5. Microsoft Help Viewer 1.0
    6. Microsoft Visual C++ 2010 Redistributable
    7. Microsoft Visual C++ 2010 Standard Edition
    8. Additionally removed all .NET and VC++ related MS Software (not tested if necessary)
  4. choosing Windows7.1SDK as Platform Toolset in VS2013
  5. error MSB6006: "CL.exe" exited with code -1073741515
  6. cl.exe looks for one of msobj100.dll, mspdb100.dll, mspdbcore.dll and mspdbsrv.exe
  7. Added to PATH: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
  8. Build works and binary is usable!

A mistake I did:

  1. copied files in 6. above to C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin, believing this directory is in PATH, but it was not!
  2. So better do as sugested in 7. above or by Yodan in How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?
like image 5
Kai Schubert Avatar answered Nov 11 '22 19:11

Kai Schubert