Solved

Unresolved external.

Posted on 2002-03-14
5
376 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
returning a dereferenced pts in C++ 10 167
Setting nameservers after res_init fails doing res_query 2 119
c++ syntax question 9 58
Unable to start eclipse ? 17 163
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

756 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