Thursday, April 23, 2015

windows 7 - Visual Studio 2012: cl.exe -1073741701 on x86 only

I'm using Visual Studio 2012 Professional updated to SP5 under Windows 7 SP1 with latest updates.
I needed Visual Studio 2015 for some time, installed then uninstalled it with standard uninstaller.


But today I needed to build Webkit for Windows, and its build script ran vswhere.exe and detected some parts from Visual Studio 2015 as "working" installation, so I needed "full" uninstall for VS2015, which I found here: https://github.com/Microsoft/VisualStudioUninstaller.
I ran it once, and VS2015 disappeared from vswhere.exe output.


But now I have a problem:
Every app I trying to compile with VS2012 gives "cl.exe terminated abnormally with code -1073741701".


I tried :



  • Reinstalled VS2012 with or without SP5 multiple times, including clean reinstall (uninstall main, uninstall dependencies, install again), still same error.

  • Tried to repair VS2012.

  • I tried to run C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe, it says "mspdb110.dll not found".

  • I copied
    Msobj110.dll,
    Mspdb110.dll,
    Mspdbcore.dll and
    Mspdbsrv.exe
    from
    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
    and added to the PATH
    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE. Still same error.


If I switch project platform to x64, it compiles and runs without a problem. Only x86 compiler cannot run and gives the error above. Sometimes there is a popup in VS2012 that "cl.exe cannot run code 0xc000007b".


If I run
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat x86,
I can run cl.exe and even compile working 32-bit apps, but inside Visual Studio 2012 IDE it fails to run cl.exe every time, no matter what I do.


Please help me to fix it.


I think maybe it's something to do with .NET Framework (I have 4.5, 4.6 and 4.7 installed) in the MSBuild folder. Maybe I need to reinstall .NET Framework SDK somehow? If possible, I want to avoid reinstalling OS.


EDIT:
Started a bounty. Still have a same problem.


I tried to insert run cl.exe without parameters in "Run before build..." script, and it runs from there! But afterward the IDE runs cl.exe from .NET environment and gives:



C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB6006: "CL.exe" terminated error code -1073741701



If I select x64 platform, cl.exe runs everywhere perfectly fine.
If I run vcvarsall.bat x86, I can run cl.exe and compile.


The only thing I need to fix is some path in environment which used for Win32 x86 build from Visual Studio 2012 IDE. I can reinstall .NET Framework or Visual Studio (tried it but anyway) or edit some MSBuild configurations. Please tell me where possible to fix. The only thing I cannot do is reinstall OS, as I have a lot of software and reinstall will take a LOT of time.


UPDATE:
Tried to uninstall everything, including .NET Framework 4.5, 4.6, 4.7 and Microsoft SQL Server 2008, 2012. Then installed Visual Studio 2012 Professional RTM. After install on first run I opened test app and got same error as above...
x64 version works. Same after installing SP5.


UPDATE2:
Tried to bring files of Visual Studio 2012 and Windows SDK and msbuild from working Windows 7 SP1 virtual machine install. It doesn't fix an error, same problem. Also tried to replace cl.exe with dummy 32-bit app, still causes 0xc000007b every time I run build from IDE. Seems like when ran from IDE Visual Studio uses cl.exe 32-bit with some 64-bit DLL. But I don't know how to find it and how to fix.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...