Solved

LNK2001 Error

Posted on 2000-04-01
1
556 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
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…
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

730 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