Unresolved external symbols when using VC .NET compiler but not when using VC6

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having a bit of trouble getting a project to build under VS7. I have a DLL that is including a static MFC library, but when it comes to the link stage I get 4 of:

Crpe error LNK2001: unresolved external symbol "private: __thiscall CObject::CObject(class CObject const &)" (??0CObject@@AAE@ABV0@@Z)

If I compile the static MFC library in VS6 and then use it to build my DLL in VS7 everything is fine (no build errors at all). I've checked the project settings and everything seems to be ok (no major diffs between VS6 and VS7). I've noticed a few other people have had similar problems, but I havent seen any solutions posted yet. Does anyone have any idea what is causing this?


Thanks
Shaun
 
It turns out the problem is with an object which was derived from CObject and being thrown. Once I changed that object to derive from CException the project linked successsfully. Hopefully that will save someone else from wasting a lot of time :)

I'm not sure why you could throw an object derived from CObject in VS6 but not in VS7, but the code seems to work now.


Shaun
 
Back
Top