Solved

LNK2001 Error

Posted on 2000-04-01
1
539 Views
Last Modified: 2007-10-18
I seem to keep getting errors on compilemfcwg32d.lib(CHGRID.OBJ) : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass  CWnd::classCWnd" (?classCWnd@CWnd@@2UCRuntimeClass@@A)
mfcwg32d.lib(CHCOMB.OBJ) : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass  CWnd::classCWnd" (?classCWnd@CWnd@@2UCRuntimeClass@@A)
mfcwg32d.lib(CHLIST.OBJ) : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass  CWnd::classCWnd" (?classCWnd@CWnd@@2UCRuntimeClass@@A)

its not my .lib, but i was wondering how to make the compiler ignore/fix these....Under vs97. i have all the include files .h, but not one single .cpp file eg chlist.cpp/chgrid.cpp, well you get it. Can i extract the .obj from the .lib?, than the .cpp files, or am i looking in the wrong direction?

ive been banging my head up against the wall for awhile. tried lib.exe, shows the .obj files
tried extracing /out but no avail.
/nologo /MT /W3 /GR /GX /O2 /I ".\include" /I ".\widgets\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp".\ace.rel/Ace.pch" /Yu"stdafx.H" /Fo".\ace.rel/" /Fd".\ace.rel/" /FD /c

some idea is better than nothing...can you plz advise me wht to do?

thanks in advance




0
Comment
Question by:dperrin
1 Comment
 
LVL 1

Accepted Solution

by:
Dhrubajyoti earned 8 total points
ID: 2706391
According to msdn help
there are two reasons this error occurs: what the code asks for doesn’t exist (the symbol is spelled incorrectly or uses the wrong case, for example), or the code asks for the wrong thing (you are using mixed versions of the libraries?some from one version of the product, others from another version).

you must have the library file (.lib )file for each header file.Because it will look for the functions in .lib file wile linking .if u have the .c or .cpp implementation file compiler will generate the .lib file .


 
 
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

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…
  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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

762 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

16 Experts available now in Live!

Get 1:1 Help Now