Re: LNK2001: unresolved external
- From: "leov SpamMeNot" <lviolette.SpamMeNot@xxxxxxxxxx>
- Date: Thu, 29 Sep 2005 19:22:33 -0700
See inline...
"Jon Evans" <JonEvans@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EE351310-20C8-4E8B-90B9-F8582031AD56@xxxxxxxxxxxxxxxx
>
>
> "www.fruitfruit.com" wrote:
>
>> A SMALL piece of code may help us understand your problem better.
>>
>>
>
> Well, :-
>
> Header file :-
>
> class MyClass
> {
> MyClass() ;
> virtual ~MyClass() ;
> } ;
>
> C file
>
> #include "MyClass.h"
> MyClass()
> {
> }
>
> ~MyClass()
> {
> }
off the top of my head, I'd say:
MyClass::MyClass(void)
{
}
MyClass::~MyClass(void)
{
}
>
> These are in a MFC extension DLL. The DLL builds find both debug functions
> and release functions.
>
> Now create a seperate test app - it does not use MyClass directly, it uses
> another class who contains a (protected) member variable of type
> MyClass().
>
> The test app compiles and runs perfectly in debug mode. However it refuses
> to link, claiming that it cant find CMyClass's destructor.
>
> Strip out the destructor from the original CPP and move it to the header
> :-
>
> class MyClass
> {
> MyClass() ;
> virtual ~MyClass() { } ; // <---------
> } ;
>
> Now the release build of the test app compiles and runs perfectly.
>
> Add a dozen more functions (that also get called) to this class and the
> linker will still find them, it just seems to have a bit of a "thing" with
> destructors.
>
> If I now derive CMyClass from CObject, it'll fail to compile again in
> exactly the same way but one of the Cobject-related functions is now
> missing.
>
> This must be a symptom of something wrong else where, but I can't think
> what. Incidently the DLL has dozens of classes (some exported, some not)
> and
> it's happy with them, it's only if I now add any new classes that the
> problem
> occurs.
>
> TTFN,
> Jon
>
>
>
.
- References:
- Re: LNK2001: unresolved external
- From: www.fruitfruit.com
- Re: LNK2001: unresolved external
- From: Jon Evans
- Re: LNK2001: unresolved external
- Prev by Date: Icon on the task bar but not on the window?
- Next by Date: Bug in documentation of CPoint?
- Previous by thread: Re: LNK2001: unresolved external
- Next by thread: Re: LNK2001: unresolved external
- Index(es):
Relevant Pages
|