error while compilation

Hi,
I Am am having these error messages at compilation


Linking...
RasClient.obj : error LNK2001: unresolved external symbol "public: class CString const & __thiscall CString::operator=(char const *)" (??4CString@@QAEABV0@PBD@Z)
RasClient.obj : error LNK2001: unresolved external symbol "void __cdecl AfxTrace(char const *,...)" (?AfxTrace@@YAXPBDZZ)
RasClient.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::~CString(void)" (??1CString@@QAE@XZ)
RasClient.obj : error LNK2001: unresolved external symbol "public: int __thiscall CString::CompareNoCase(char const *)const " (?CompareNoCase@CString@@QBEHPBD@Z)
RasClient.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(void)" (??0CString@@QAE@XZ)
RasClient.obj : error LNK2001: unresolved external symbol "public: void __thiscall CString::ReleaseBuffer(int)" (?ReleaseBuffer@CString@@QAEXH@Z)
RasClient.obj : error LNK2001: unresolved external symbol "public: char * __thiscall CString::GetBuffer(int)" (?GetBuffer@CString@@QAEPADH@Z)
RasClient.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::operator char const *(void)const " (??BCString@@QBEPBDXZ)
RasClient.obj : error LNK2001: unresolved external symbol "bool __stdcall operator==(class CString const &,char const *)" (??8@YG_NABVCString@@PBD@Z)
RasClient.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(class CString const &)" (??0CString@@QAE@ABV0@@Z)
RasClient.obj : error LNK2001: unresolved external symbol "bool __stdcall operator!=(class CString const &,char const *)" (??9@YG_NABVCString@@PBD@Z)
RasClient.obj : error LNK2001: unresolved external symbol "public: class CString const & __thiscall CString::operator=(class CString const &)" (??4CString@@QAEABV0@ABV0@@Z)
RasClient.obj : error LNK2001: unresolved external symbol "class CString  __stdcall operator+(class CString const &,class CString const &)" (??H@YG?AVCString@@ABV0@0@Z)
RasClient.obj : error LNK2001: unresolved external symbol "public: void __cdecl CString::Format(char const *,...)" (?Format@CString@@QAAXPBDZZ)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/RasClient.exe : fatal error LNK1120: 15 unresolved externals
Error executing link.exe.


thansk
tparvaizAsked:
Who is Participating?
 
mflamConnect With a Mentor Commented:
1. In your project settings (hope you know how to get there)
2. Go to the lib tab.
3. Inside the page there is a dropdown that says: General.
Change it to Input.
4. On the line with Object/Library Modules:
4.1 ADD (Do not erase something if there is anything written)
rasapi32.lib

Now build (link) your project again.

If this doesn't work look up the rasapi32.lib and the rasapi32.dll in your machine. If they are missing you'll need to get them.

You know what libs you need when you open the MSDN and look at the bottom of the functions. You'll find: QUICKINFO.
At the bottom of RasDial for instance there is QuickInfo:
Windows NT ...
Header: declared in ras.h
Import Library: use rasapi32.lib

Moshe
0
 
captainkirkCommented:
try #include <afx.h> and link with the appropriate lib(s) for your build:

Here's the defs from afx.h:


#ifndef _AFXDLL
      #ifndef _UNICODE
            #ifdef _DEBUG
                  #pragma comment(lib, "nafxcwd.lib")
            #else
                  #pragma comment(lib, "nafxcw.lib")
            #endif
      #else
            #ifdef _DEBUG
                  #pragma comment(lib, "uafxcwd.lib")
            #else
                  #pragma comment(lib, "uafxcw.lib")
            #endif
      #endif
#else
      #ifndef _UNICODE
            #ifdef _DEBUG
                  #pragma comment(lib, "mfc42d.lib")
                  #pragma comment(lib, "mfcs42d.lib")
            #else
                  #pragma comment(lib, "mfc42.lib")
                  #pragma comment(lib, "mfcs42.lib")
            #endif
      #else
            #ifdef _DEBUG
                  #pragma comment(lib, "mfc42ud.lib")
                  #pragma comment(lib, "mfcs42ud.lib")
            #else
                  #pragma comment(lib, "mfc42u.lib")
                  #pragma comment(lib, "mfcs42u.lib")
            #endif
      #endif
#endif

#ifdef _DLL
      #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
            #pragma comment(lib, "msvcrtd.lib")
      #else
            #pragma comment(lib, "msvcrt.lib")
      #endif
#else
#ifdef _MT
      #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
            #pragma comment(lib, "libcmtd.lib")
      #else
            #pragma comment(lib, "libcmt.lib")
      #endif
#else
      #if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
            #pragma comment(lib, "libcd.lib")
      #else
            #pragma comment(lib, "libc.lib")
      #endif
#endif
#endif
0
 
tparvaizAuthor Commented:
I've included afx.h in my project (already had it) but still having same error

may be I've included it incorrectly


Thanks for your time
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
tparvaizAuthor Commented:
When I am compiling my .cpp files it is compiling correctly, but when I am building .exe file getting errors


thanks
0
 
captainkirkCommented:
Check to see if you are linking with the appropriate libraries listed above... you are getting unresolved externals because the linker can't find the entry points for the functions listed in your output... you would change the project settings in your IDE or the linker options on the command line you are using to compile and link...
0
 
tparvaizAuthor Commented:
I've downloaded a zip-file and extracted it to one of my folders. Initially I had many file missing errors which were resolved when I copied several (required) header files to the same folder where my .cpp and .h files are.

Please let me know that how to change the path of link and compiler

thanks for your time
0
 
captainkirkCommented:
that would be specific to the compiler - what compiler are you using??
0
 
tparvaizAuthor Commented:
Microsofts Visual C++6
0
 
tparvaizAuthor Commented:
Microsofts Visual C++6
0
 
captainkirkCommented:
Select the project/settings menu, and look in the link tab of the dialog that comes up... should have the appropriate libs selected. The "normal" libs that the IDE looks for don't need to be specifically included, so you might check this: in the tools/options menu, under the directories tab, you should have the locations where VC++ looks for libs, like:

d:\Visual Studio\VC98\MFC\LIB
d:\Visual Studio\VC98\LIB


see if that helps...
0
All Courses

From novice to tech pro — start learning today.