13

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.

foxx1337
  • 1,859
  • 3
  • 19
  • 23
  • 2
    Just as an aid, the exit code can be interpreted as `0xC0000135` (the unsigned version of the code you have), which will probably turn up more results when doing a search. A quick search for that turns up a possibility that you may be linking 32-bit libraries in a 64-bit project? Or you've not run the correct vcvarsall.bat? – icabod Feb 26 '14 at 10:40
  • Thanks for the reply! I'm running from within the IDE. Win32 Debug, Release, x64 Debug, Release, with Clean Project in between give the same error. – foxx1337 Feb 26 '14 at 10:46
  • For that matter I created a new Console Application project and it doesn't compile with Windows7.1SDK. – foxx1337 Feb 26 '14 at 10:51
  • All I can suggest is to check the 2013 equivalent of "Projects and Solutions" in Options (sorry, I have only have 2008 here!!), and check that the paths to Library Files for win32 and win64 projects are set correctly (`$(WindowsSdkDir)\lib` and `$(WindowsSdkDir)\lib\x64` or similar). – icabod Feb 26 '14 at 10:56
  • Include directories are `$(WindowsSdkDir)\include;$(VCInstallDir)include` and if I expand and click on macros, I can see `$(WindowsSdkDir)` as `C:\Program Files\Microsoft SDKs\Windows\v7.1\ ` which is correct on my machine. Same for libs - `$(WindowsSdkDir)lib;$(VCInstallDir)lib`. – foxx1337 Feb 26 '14 at 11:01
  • Similar to: https://stackoverflow.com/q/4189109/1959808 – 0 _ Apr 23 '21 at 10:13

3 Answers3

13

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.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Thank you! I only installed 7.1 sdk because I needed Platform Tools v100. I am not sure the 7.1 SDK includes them and I don't have a Visual Studio 2010 setup available. – foxx1337 Feb 26 '14 at 12:03
  • I highly doubt it since the SDK installer in general pays attention to VS being installed. And wouldn't know beans about the way platform toolsets work, that was added later. The exit code loudly says "No!" of course. – Hans Passant Feb 26 '14 at 12:09
  • 2
    Today I Learned! Got Process Monitor, filtered by `cl.exe`, it was `CreateFile`ing without success for mspdb100.dll all over the place. I guess that's it! I'll fiddle with it some more (maybe even install 2010 Express) and then post some more comments as needed and mark the answer. – foxx1337 Feb 26 '14 at 12:29
  • Visual Studio Community 2015 has the SDK as install feature. – Cees Timmerman Sep 17 '15 at 12:36
5

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?
Community
  • 1
  • 1
Kai Schubert
  • 91
  • 1
  • 6
0

The following steps work for me in VS 2017.

1.Close VS 2017. 2.Restart machine. 3.Open solution in VS 2017. 4.Build the project. This time I didn't get following error and it builds successfully.

error msb6006 "link.exe" exited with code -1073741819.

Pabitra Dash
  • 1,461
  • 2
  • 21
  • 28
  • So dumb the amount of times that a reboot fixes Microsoft products. It has started happening more on macOS recently as well, but there's a reason IT Crowd was able to make such a meme out of "have you tried turning it off and on again?" – dragon788 Apr 16 '20 at 16:08