C++ application fails to start correctly (0xc000000d)

开发者使用VS2010在两台Win7 64位SP1系统上进行C++应用开发,通过Git同步代码库。一台机器的Debug版本应用无法正常启动,显示错误代码0xc000000d。已尝试删除仓库、更新依赖包等方法但未解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >



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.

share improve this question
 
4 
Use Dependency Walker - 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  Apr 13 '11 at 11:37
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
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

7 Answers

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.

share improve this answer
 

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.

share improve this answer
 

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?

share improve this answer
 
 
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  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

This is the weirdest thing....

Try deleting the "ipch" directory and then rebuilding.

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

share improve this answer
 
 
I tried git cleanup several times, which also deletes the ipch directory to no avail –   Jonathan  May 14 '11 at 9:59

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.

share improve this answer
 

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

share improve this answer
 

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.

share improve this answer

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.

share improve this question
 
4 
Use Dependency Walker - 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  Apr 13 '11 at 11:37
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
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

7 Answers

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.

share improve this answer
 

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.

share improve this answer
 

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?

share improve this answer
 
   
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  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

This is the weirdest thing....

Try deleting the "ipch" directory and then rebuilding.

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

share improve this answer
 
   
I tried git cleanup several times, which also deletes the ipch directory to no avail –   Jonathan  May 14 '11 at 9:59

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.

share improve this answer
 

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

share improve this answer
 

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.

share improve this answer
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值