A Link Error about STL

Discussion in 'C++' started by DDD, Mar 4, 2011.

  1. DDD

    DDD Guest

    Hi,
    Can anyone explain these two error more details?

    1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: “public: virtual
    __thiscall std::exception::~exception(void)” (??
    1exception@std@@UAE@XZ) already defined in Main.obj
    1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: “public: virtual char
    const * __thiscall std::exception::what(void)const ” (?
    what@exception@std@@UBEPBDXZ) already defined in Main.obj

    Thanks in advance.
     
    DDD, Mar 4, 2011
    #1
    1. Advertisements

  2. DDD

    Puppet_Sock Guest

    On Mar 4, 10:19 am, DDD <> wrote:
    > Hi,
    > Can anyone explain these two error more details?
    >
    > 1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: “public: virtual
    > __thiscall std::exception::~exception(void)” (??
    > 1exception@std@@UAE@XZ) already defined in Main.obj
    > 1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: “public: virtual char
    > const * __thiscall std::exception::what(void)const ” (?
    > what@exception@std@@UBEPBDXZ) already defined in Main.obj
    >
    > Thanks in advance.


    I'm just taking a wild stab in a dimly lit room.
    You seem to have double-included something that
    does not have proper double-include guards, or
    you have managed somehow to break the guards.

    If it was me, I would be "rounding up the usual
    suspects." I'm guessing you are using Microsoft's
    compiler. Try starting with the flags for stricter
    compliance. Try not using the using directive.
    Try making a debug copy of your project and removing
    half the code and see if it still gives the message.
    The usual stuff.
    Socks
     
    Puppet_Sock, Mar 4, 2011
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Allan Bruce

    To STL or not to STL

    Allan Bruce, Oct 16, 2003, in forum: C++
    Replies:
    41
    Views:
    1,485
    Christopher Benson-Manica
    Oct 17, 2003
  2. =?ISO-8859-15?Q?R=E9mi_Peyronnet?=

    STL & basic_string<XMLCh> link error

    =?ISO-8859-15?Q?R=E9mi_Peyronnet?=, Feb 16, 2004, in forum: C++
    Replies:
    0
    Views:
    601
    =?ISO-8859-15?Q?R=E9mi_Peyronnet?=
    Feb 16, 2004
  3. sriram
    Replies:
    5
    Views:
    909
    sriram
    Mar 16, 2005
  4. mcole
    Replies:
    1
    Views:
    1,211
    Lionel B
    Apr 14, 2005
  5. pervinder

    STL link error on AIX

    pervinder, Aug 4, 2004, in forum: C Programming
    Replies:
    2
    Views:
    1,238
    Thomas Matthews
    Aug 4, 2004
  6. Replies:
    4
    Views:
    1,023
    Daniel T.
    Feb 16, 2006
  7. Replies:
    2
    Views:
    690
    klaus hoffmann
    Feb 22, 2006
  8. Replies:
    5
    Views:
    743
    Markus Schoder
    Apr 16, 2006
Loading...