Solved

Unresolved external.

Posted on 2002-03-14
5
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

739 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