I'm currently writing a VFW codec, but am getting:

Code:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I've narrowed it down to a simple test case, but the test case makes no sense. In the test case, my DriverProc() returns 0 every time, so that installation fails immediately, and the video codec manager goes about its business without bringing up my codec. But when I add the other two object files at linktime, neither of which ever gets anything in them run under any circumstance, the crash comes back. Here are all the source files:

drvproc.cpp
Code:
#include <windows.h>

extern "C" LRESULT WINAPI DriverProc (DWORD dwDriverID, HDRVR hDriver, UINT uiMessage, LPARAM lParam1, LPARAM lParam2)
{
  MessageBox (0, "Driver Pork Reached", "Driver Pork", 0);
  return 0;
}  

extern "C" BOOL WINAPI DllMain (HINSTANCE hinst,DWORD reason,LPVOID lpReserved)
{
  MessageBox (0, "Dull Mane Reached", "Dull Mane", 0);
  return 1;
}
c1.h
Code:
#ifndef C1_H
#define C1_H

#include "c2.h"

struct C1
{
  C2 *c;
  void foobar ();
};

#endif // C1_H
c2.h
Code:
#ifndef C2_H
#define C2_H
 
struct C2
{
  C2 ();
};

#endif // C2_H
c1.cpp
Code:
#include "c1.h"

void C1::foobar ()
{
  c = new C2 (); // comment out this line, and the crash disappears
}
c2.cpp
Code:
#include "c2.h"
C2::C2 ()
{
}
I'm compilling with mingw gcc 4.5.2. Any help would be appreciated; I really have no idea what to make of it. None of the code in c1 or c2 ever gets run, yet linking it in makes the thing crash. And commenting out the one indicated line above makes the crash go away. I'm not really much of a C++ coder, unfortunately..