Link to home
Start Free TrialLog in
Avatar of Marsc
Marsc

asked on

Unresolved external.

Hello Experts.

I am working in a project.
Using VC++ 6.00.

Every thing is ok when I compile in Release configuration.
The problem is when I try to compile using the Debug configuration.

I get this error

Linking...
ReadFromFile.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CObjBase::VerifyClick(int,int)" (?VerifyClick@CObjBase@@UAEHHH@Z)
ReadFromFile.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CObjBase::MeDraw(struct HDC__ *)" (?MeDraw@CObjBase@@UAEXPAUHDC__@@@Z)
Debug/GeoVisual.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

I guess it is not a critical situation while a can compile in Release mode, but this gets me a little worried.

Thank you very much.

Avatar of jkr
jkr
Flag of Germany image

That seems to be related to precompiled headers and incremental linking. Try to delete all intermediate files by choosing "Clean" from the "Build" menu, then compile again...
Avatar of lidorc
lidorc

I belive it isn't related with the precompiled headers.
Look in the project settings (ALT+F7), over there you can define libraries for the liker to look for. Look under the Link tab under General. On the left side of that screen you can choose the configuration (Release or Debug) so finde the differences and add the missing library or whatever is necessary.
Avatar of Marsc

ASKER

Well....
It is strange but the flaw was this one.

It is in a class that has a member "virtual void Proc(HDC hDC);"
I changed that to "virtual void Proc(HDC hDC){return}"
And it worked.

I guess I will accept some answer (After all you have  taken time to help me), but it seems it had nothing to do with libraries.....

ASKER CERTIFIED SOLUTION
Avatar of lidorc
lidorc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marsc

ASKER

Yes... I am sure it was that....

Well I accept your comment because you reminded me the correct way to create an abstract class.

The problem is I was doing it wrong...
As I told you...

The original line in the base class was.

virtual void member(HDC hDC,...etc);

I changed that to:

virtual void member(HDC hDC,...etc){return;};
It worked fine....
But I guess "virtual void member(HDC hDC,...etc) = 0;" is more professional...

It was a little long since I had to write a program.... Some little details just got away from my mind... :-)