开发者

curious exception in Visual C++ 10 at runtime

Today I got really strange exception at runtime. I tried to debug step by step, but the exception occurs befor开发者_如何学JAVAe main() is called.

So I removed every include and the whole code (commented it), and added an empty main() function.

And again, after compiling it occurs. Maybe a project configuration bug?

BTW: after the exception, VC10 Debugger goes to strlen.asm and says empty pointer.

The VS10 solution got 2 projects the second works really well, and the first did too, but after I compiled the second project, it stopped working.

The Projects have the same Output of the binaries, but they got an extra output folder for obj etc.. files, for each Project.

So, whats going on there?


The problem is most likely part of the initialization of a global or static object which then calls strlen with a null pointer. Do you have any globals in any .cpp? Or any statics in some classes?

Note that, even if you remove everything from the main.cpp, the other .cpp files will still be compiled and cause the error.


Without any details it's hard to say anything precise, so I can only share advice based on two similar experiences I had. It wasn't in Visual Studio, but you might happen to have the same problem.

  1. You might need a dynamically loaded component (dll, ocx etc.) that is not in the path where you run the debug version from.

  2. You might have misbehaving global initializations

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜