Solved

Unresolved external.

Posted on 2002-03-14
5
371 Views
Last Modified: 2010-04-01
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.

0
Comment
Question by:Marsc
  • 2
  • 2
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6864704
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...
0
 
LVL 1

Expert Comment

by:lidorc
ID: 6866291
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.
0
 
LVL 1

Author Comment

by:Marsc
ID: 6885421
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.....

0
 
LVL 1

Accepted Solution

by:
lidorc earned 100 total points
ID: 6886564
Are you sure this was the problem??
By the way, you can remove the "return" and just write {}
or you can change it to "virtual void Proc(HDC hDC)=0;" if this class is an abstract class.
And again.. it was something else.. something like this can't be a release/debug different..
0
 
LVL 1

Author Comment

by:Marsc
ID: 6889314
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... :-)



0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Would like to move button in a function 3 76
convert char array to number in c 5 85
How to split this in C++ 4 102
Problem with SqlConnection 4 168
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question