Thread: Trouble with multiple symbols

  1. #1
    Kotatsu
    Guest

    Trouble with multiple symbols

    I am compiling a project for a Computer Science class and I get redefined symbols EVERYWHERE in the linker so eventually I just FORECED output.

    Here are the errors, I can't display the code, there are too many files and too long of code to scan through without a find command.

    I checked that every include I ran used #ifndef and #def for their preprocessor flags. But for some reason MS won't leave me alone, but I think it works on FreeBSD.


    Code:
    --------------------Configuration: fishy - Win32 Debug--------------------
    Compiling...
    Aquamain.cpp
    Onedwalk.cpp
    Sixflips.cpp
    Linking...
    LINK : warning LNK4075: ignoring /INCREMENTAL due to /FORCE specification
    Environ.obj : warning LNK4006: "public: __thiscall apstring::apstring(void)" (??0apstring@@QAE@XZ) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: __thiscall apstring::apstring(char const *)" (??0apstring@@QAE@PBD@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: __thiscall apstring::apstring(class apstring const &)" (??0apstring@@QAE@ABV0@@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: __thiscall apstring::~apstring(void)" (??1apstring@@QAE@XZ) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: class apstring const & __thiscall apstring::operator=(class apstring const &)" (??4apstring@@QAEABV0@ABV0@@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: class apstring const & __thiscall apstring::operator=(char const *)" (??4apstring@@QAEABV0@PBD@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: class apstring const & __thiscall apstring::operator=(char)" (??4apstring@@QAEABV0@D@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: int __thiscall apstring::length(void)const " (?length@apstring@@QBEHXZ) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: char const * __thiscall apstring::c_str(void)const " (?c_str@apstring@@QBEPBDXZ) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: char & __thiscall apstring::operator[](int)" (??Aapstring@@QAEAADH@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: char __thiscall apstring::operator[](int)const " (??Aapstring@@QBEDH@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "class ostream & __cdecl operator<<(class ostream &,class apstring const &)" (??6@YAAAVostream@@AAV0@ABVapstring@@@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "class istream & __cdecl operator>>(class istream &,class apstring &)" (??5@YAAAVistream@@AAV0@AAVapstring@@@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "class istream & __cdecl getline(class istream &,class apstring &)" (?getline@@YAAAVistream@@AAV1@AAVapstring@@@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: class apstring const & __thiscall apstring::operator+=(class apstring const &)" (??Yapstring@@QAEABV0@ABV0@@Z) already defined in Display.obj; second definition ignored
    Environ.obj : warning LNK4006: "public: class apstring const & __thiscall apstring::operator+=(char)" (??Yapstring@@QAEABV0@D@Z) already defined in Display.obj; second definition ignored
    Here are SOME of the errors, there are 1280 more

  2. #2
    Kotatsu
    Guest
    btw:
    I used the FORCE option so they are labled as warnings and second definitions (WHICH THERE ARE NONE!) are "ignored"

  3. #3
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Could you show us some source?
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    hmm... weird.

    are you sure you are including apstring.cpp in the project. it doesn't look like it because it isn't being linked.

    MBCS I see.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 06-08-2009, 03:03 PM
  2. Replies: 7
    Last Post: 02-02-2009, 07:27 AM
  3. Trouble with Windows/DirectX programming
    By bobbelPoP in forum Windows Programming
    Replies: 16
    Last Post: 07-08-2008, 02:27 AM
  4. Strange error?
    By MrLucky in forum C++ Programming
    Replies: 5
    Last Post: 02-04-2006, 03:01 PM
  5. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 02:41 AM