6

I'm writing a C++ application using VS2010 on two dev computers - both are Win7 64bit SP1. I use git to sync the repositories.

On one of the machines the compiled executable (and also the test exec) stopped working with the following error, while on the other machine it works fine and I'm able to continue development.

The application was unable to start correctly (0xc000000d). Click OK to close the application.

I tried deleting the repository and cloning it again. I also made sure I have the same versions of Boost, git, Visual Studio. Also, I tried debugging (stepping in) but the error occurs before any line of code is reached.

Notice as far as I understand I'm tracking Visual Studio's solution\project configuration files as detailed here.

I'm at a loss, how would you debug this?

UPDATE 1: Only the Debug version fails to run. The Release version runs fine

UPDATE 2: The executable that doesn't work does work on the other computer!

UPDATE 3: I've reinstalled VS2010 (exactly the same version) - didn't help. Surprisingly the compiled files are not the same size between the two machines.

Community
  • 1
  • 1
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
  • 4
    Use Dependency Walker - http://www.dependencywalker.com/ - see if there's DLL version differences. – Erik Apr 13 '11 at 11:31
  • Can you debug it and check until where it is able to run? – rturrado Apr 13 '11 at 11:34
  • @rturrado - I tried debugging (stepping in) but the error occurs before any line of code is reached – Jonathan Livni Apr 13 '11 at 11:37
  • Are you compiling on one or both machines? – Collin Dauphinee Apr 13 '11 at 11:38
  • Is Visual C++ installed on both machines? Is it the same version of Visual C++? – James McNellis Apr 13 '11 at 12:00
  • @James - Both Visual Studios are 10.0.30319.1 – Jonathan Livni Apr 13 '11 at 12:31
  • @dauphic - yes, I'm compiling on both machines (also see UPDATE 2 above) – Jonathan Livni Apr 13 '11 at 12:33
  • 1
    Check the references to the WinSXS cache. The same library VC90.CRT (this is for VS2008, asume the predecessor) may be available in different versions. This can be caused by a VS service pack installed only on one of the computers. Check the version required by the developped application and the version found in WinSXS. – harper Apr 13 '11 at 12:34
  • Can you log some messages (if yes, put some messages in main)? What happens if you run debug version under debugger? – BЈовић Apr 13 '11 at 12:51
  • @VJo - I tried debugging (stepping in) but the error occurs before any line of code is reached – Jonathan Livni Apr 13 '11 at 13:00
  • That can also mean that some static initialization failed. But it sounds more like a library incompatibility. – BЈовић Apr 13 '11 at 13:06
  • You could maybe use WinDbg + gflags so that debugger is attached at the very beginning of the execution. Anyway, check this other question out: http://stackoverflow.com/questions/4243126/program-crashes-with-0xc000000d-and-no-exceptions-how-do-i-debug-it. BTW, this may be a Visual Studio issue. Have you tried running the Debug version out of Visual Studio? – rturrado Apr 13 '11 at 13:36
  • 3
    Can you look in the event logs for more information regarding this exception, as well as the address it's occurring at? – Collin Dauphinee Apr 13 '11 at 17:08

9 Answers9

3

I got the same problem as you mentioned. My solution:

  1. Clean the manifest file and rebuild
  2. In the property page-> Manifest tool -> make sure "Additional Options" is set to nothing. (I set it as "/validate_manifest" before).

Or you can try "Embed Manifest -> NO", rebuild and then set back to Yes. It sounds to be ridiculous, but it really works sometimes. I don't know why.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Steve
  • 31
  • 2
2

I got the same phenomenon suddenly without a warning on Win7 / VS2010 / C++. Debug App couldn't be launched, got 0xC000000D at initializing and loading multiple dlls. Found one base dll of my own responsible, played around with linker settings. Modifying settings, incremential rebuild -> app starts, rebuild all -> app crashes again. After setting "generate manifest" to "no" in the linker settings the sample app works, but the main app still crashes. After setting "generate manifest" to "no" for the most of my dlls -> the app starts in debug mode again. The stuff is very spurious, because some dlls need the modified settings others do not.

gregwhitaker
  • 13,124
  • 7
  • 69
  • 78
1

disabling/enabling precompiled headers fixed the issue for me. I was facing crash on Debug x64 only - I guess it was related to an upgrade from boost 1.50 to 1.52, while keeping pch files.

1

Have a look at the top two answers to this question

Program crashes with 0xC000000D and no exceptions - how do I debug it?

On the machine where it fails, try running the debug executable NOT under the debugger, and update your question to say what happens. If it crashes, are you able to then attach the debugger whilst the message box is still there and get a stack trace that tells you what function it is crashing in?

Community
  • 1
  • 1
James Crook
  • 1,600
  • 12
  • 17
  • The error occurs both when I run it in VS2010 (F5) and when I run the executable. The error is a pop-up with a single OK button (no abort\retry\ignore options) – Jonathan Livni Apr 17 '11 at 14:39
  • So at that stage, are you able to attach the debugger using debug->attach-to-process ? – James Crook Apr 17 '11 at 14:42
1

This is the weirdest thing....

Try deleting the "ipch" directory and then rebuilding.

Hope it works for you, I have wasted hours on this.

Amir
  • 11
  • 1
0

in my case i got it working again by setting generate manifest to NO on all projects

ColacX
  • 3,928
  • 6
  • 34
  • 36
0

I have changed "Embed manifest" setting to NO and then back to YES but it didn't help. For me setting General->Platform Toolset to Windows SDK 7.1 for my program and all dependent libraries compiled with it helped.

0

It's the ipch just delete the entire folder and it will clear it up. I was confused for a while too.

Franky Rivera
  • 553
  • 8
  • 20
0

I saw the error while using OpenCV library compiled with MSVC2010 in a project running on MSVC2015. Changing project configuration properties->General->Platform toolset from Visual Studio 2015(v140) to Visual studio 2010(v100) resolved the error.

AMRAY
  • 21
  • 3