views:

155

answers:

3

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

return 43;

and VS crashed again.

A: 

Try reinstalling visual studio?

shoosh
That takes quite a while. Have you seen instances where VS 2008 SP1 had to be reinstalled due to a similar issue?
Eric J.
+2  A: 

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

MSalters
I'll look into building from the command line when I get home tonight (this is a hobby project).
Eric J.
I found a way to avoid using C++ in my project so never resolved this. DevEnv also crashes when compiling from the command line. I may dust this off when VS2010 is RTM. Accepting because the answer is accurate and does provide a way forward.
Eric J.
A: 

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.

Edison Gustavo Muenz
I agree that it's probably not Intellisense since the crash happens during build, but I'll give it a try anyhow. Thanks for sharing your experience.
Eric J.