apstring prob

This is a discussion on apstring prob within the C++ Programming forums, part of the General Programming Boards category; does anyone know what might cause this problem: --------------------Configuration: TAB_EDIT - Win32 Debug-------------------- Linking... MAIN.OBJ : error LNK2001: unresolved external ...

  1. #1
    pissed[off]
    Guest

    Angry apstring prob

    does anyone know what might cause this problem:

    --------------------Configuration: TAB_EDIT - Win32 Debug--------------------
    Linking...
    MAIN.OBJ : error LNK2001: unresolved external symbol "public: __thiscall apstring::~apstring(void)" (??1apstring@@QAE@XZ)
    MAIN.OBJ : error LNK2001: unresolved external symbol "class istream & __cdecl operator>>(class istream &,class apstring &)" (??5@YAAAVistream@@AAV0@AAVapstring@@@Z)
    MAIN.OBJ : error LNK2001: unresolved external symbol "public: __thiscall apstring::apstring(void)" (??0apstring@@QAE@XZ)
    Debug/TAB_EDIT.exe : fatal error LNK1120: 3 unresolved externals
    Error executing link.exe.

    ...it compiles with no errors but i get that^ when i try and run it. help please!!!!

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    13
    apstring's constructor, destructor and the operator function
    Code:
     class istream & __cdecl operator>>(class istream &,class apstring &)
    have no function bodys. That means, the compiler knows that the function exists because it's been declarared, but he didn't compile the implementation.

    1. Check if you have those 3 functions implemented
    2. Check if you have included the cpp file of apstring in you project (and campiled as well)
    3. Check if they are named correcty (with all necessary namespaces, ect.)

    example for declaration:
    Code:
    istream& operator>>(class istream&, class apstring&);
    example for implementation:
    Code:
    istream& operator>>(class istream& in, class apstring& apstr)
    {
       // whatever apstring does
       return in;
    }
    Btw, the { } braces + stuff within them is called the functions body (or, if they belong to a class, the class body).
    Teneniel
    "The Frenchmen and Russians possess the land, the British possess the sea, but we have over the airy realm of dreams command indisputably." ~ Heinrich Heine

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    To the OP. Please dont post under that name again. Its against board rules and if I notice you doing it again, I will delete your posts

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Deal or No Deal listbox prob
    By kryptkat in forum Windows Programming
    Replies: 5
    Last Post: 03-30-2009, 07:53 PM
  2. fatal error LNK1104
    By DMH in forum C++ Programming
    Replies: 2
    Last Post: 11-16-2005, 03:46 AM
  3. wierd fopen prob
    By winterflood_j in forum C Programming
    Replies: 10
    Last Post: 02-24-2004, 06:31 AM
  4. hext to binary using apstring
    By xxratcatxx in forum C++ Programming
    Replies: 1
    Last Post: 10-10-2003, 02:46 PM
  5. apstring
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 04-08-2002, 04:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21