What to do with a linker warning about a public symbol from the STL library defined in two modules?

Discussion in 'C++' started by Michel Rosien, Sep 10, 2004.

  1. Hello All,

    I'm getting the following linker warning: (I'm using Borland C++ Builder 6)

    [Linker Warning] Public symbol '_STL::basic_ostream<char,
    _STL::char_traits<char> >& _STL::eek:perator <<
    (_STL::basic_ostream<char, _STL::char_traits<char> >&, const signed char *)'
    defined in both module
    C:\ROSIEN\MONTIUM\SIMULATOR\MONTIUMSIMUTILITY.OBJ and
    C:\ROSIEN\HIGH2\BASICSIMULATOR.OBJ

    I don't understand why this is happening. Obviously this is not a symbol I
    have defined, it is an STL function.
    I know I am including <iostream> and other STL header files in a lot of my
    ..cpp files but that shouldn't be a
    problem I think?

    Does anybody know what might be the cause of such a warning and how I could
    fix it?
    And is it safe to ignore such a warning? The program seems to run fine.

    --Michel
     
    Michel Rosien, Sep 10, 2004
    #1
    1. Advertising

  2. Michel Rosien wrote in news:chs4gt$r4v$ in
    comp.lang.c++:

    > Hello All,
    >
    > I'm getting the following linker warning: (I'm using Borland C++
    > Builder 6)
    >
    > [Linker Warning] Public symbol '_STL::basic_ostream<char,
    > _STL::char_traits<char> >& _STL::eek:perator <<
    > (_STL::basic_ostream<char, _STL::char_traits<char> >&, const signed
    > char *)' defined in both module
    > C:\ROSIEN\MONTIUM\SIMULATOR\MONTIUMSIMUTILITY.OBJ and
    > C:\ROSIEN\HIGH2\BASICSIMULATOR.OBJ
    >
    > I don't understand why this is happening. Obviously this is not a
    > symbol I have defined, it is an STL function.
    > I know I am including <iostream> and other STL header files in a lot
    > of my .cpp files but that shouldn't be a
    > problem I think?
    >
    > Does anybody know what might be the cause of such a warning and how I
    > could fix it?
    > And is it safe to ignore such a warning? The program seems to run
    > fine.
    >


    It should be, you are runing your compiler in a non-standard mode,
    not a difficult thing with CBuilder BTW.

    It should be *merging* duplicates of this template function, but it
    isn't (at least not without issuing the warning).

    Check the help pages, and build option's (if your using the IDE),
    look for option's related to template's, instantiation and merging,
    check out warning related option's too.

    To get better advice than this goto a borland newsgroup, they have names
    starting with borland.public.*, you may want one of the ones in the
    borland.public.cppbuilder.* hierarchy.

    HTH.

    Rob.
    --
    http://www.victim-prime.dsl.pipex.com/
     
    Rob Williscroft, Sep 10, 2004
    #2
    1. Advertising

  3. Thanks for the help

    > It should be, you are runing your compiler in a non-standard mode,
    > not a difficult thing with CBuilder BTW.


    I'm not sure what you mean here. It is running in default mode.

    > It should be *merging* duplicates of this template function, but it
    > isn't (at least not without issuing the warning).


    So you say that the warning is not caused by some error of mine
    and it should not issue the warning?

    > To get better advice than this goto a borland newsgroup, they have names
    > starting with borland.public.*, you may want one of the ones in the
    > borland.public.cppbuilder.* hierarchy.


    I'll look there

    --Michel
     
    Michel Rosien, Sep 10, 2004
    #3
  4. Michel Rosien wrote in news:chsfqp$dfh$ in
    comp.lang.c++:

    > Thanks for the help
    >
    >> It should be, you are runing your compiler in a non-standard mode,
    >> not a difficult thing with CBuilder BTW.

    >
    > I'm not sure what you mean here. It is running in default mode.


    Indeed, default mode != Standard conforming.

    >> It should be *merging* duplicates of this template function, but it
    >> isn't (at least not without issuing the warning).

    >
    > So you say that the warning is not caused by some error of mine
    > and it should not issue the warning?


    Yup.


    Rob.
    --
    http://www.victim-prime.dsl.pipex.com/
     
    Rob Williscroft, Sep 10, 2004
    #4
    1. Advertising

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. Charles A. Lackman
    Replies:
    1
    Views:
    1,445
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    641
    SpamProof
    Oct 21, 2003
  3. Steve Mauldin
    Replies:
    5
    Views:
    1,754
    Steve Mauldin
    Jan 26, 2006
  4. baumann@pan
    Replies:
    1
    Views:
    769
    Richard Bos
    Apr 15, 2005
  5. Vijay Bajwa
    Replies:
    3
    Views:
    364
    Vijay Bajwa
    Jan 26, 2007
Loading...

Share This Page