Solved

Unresolved external.

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now