开发者

Basic C++ program crashes VS 2008

开发者 https://www.devze.com 2022-12-17 22:00 出处:网络
I\'m following this tutorial on wrapping a .lib in a C++ DLL. Right after I use the VS wizard to generate a Win32 DLL project, everything compiles just fine.

I'm following this tutorial on wrapping a .lib in a C++ DLL.

Right after I use the VS wizard to generate a Win32 DLL project, everything compiles just fine.

Then, following the tutorial, I substitute this VS-generated code:

DEMODLL_API int fnDemoDll(void)
{
    return 42;
}

for this code:

DEMODLL_API int fnDemoDll(int a,int b)
{
    return a+b;
}

When I then build, the VS 2008 SP1 IDE crashes.

Google turned up several hits for this type of crash, but nothing that seems to apply.

There is an entry in the event viewer related to the crash:

Faulting application devenv.exe, version 9.0.30729.1, time stamp 0x488f2b50, faulting module VCProjectEngine.dll, version 9.0.30729.1, time stamp 0x488f2e94, exception code 0xc0000005, fault offset 0x0003dd11, process id 0x1f80, application start time 0x01ca98d27f9c8b85.

UPDATE:

I recreated the project, compiled it was fine, changed

return 42;

to开发者_JAVA技巧

return 43;

and VS crashed again.


The exact code is probably irrelevant. It's the IDE, not the compiler that crashes. Can you start the build in another way?


I've had similar problems with my VS 2008. To me what was happening was that the IDE suddenly closed with no more info.

I then tried to debug the IDE with DebugDiag. This program can debug external applications, dump their symbols, do a stack trace, etc. It can be very helpful for these kinds of problems, where you have no idea what could be causing such a problem.

My problem was solved by disabling the Intellisense by renaming it to a new name (so then it was disabled). Your problem can be different, but DebugDiag can help you diagnose that.

If you wan to try disabling Intellisense and see if it works for you, try renaming \Microsoft Visual Studio 9.0\VC\vcpackages\feacp.dll to something else and see if it works. However, this doesn't seem to be your problem.

0

精彩评论

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

关注公众号