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

M

Michel Rosien

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
 
R

Rob Williscroft

Michel Rosien wrote in 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.
 
M

Michel Rosien

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
 
R

Rob Williscroft

Michel Rosien wrote in in
comp.lang.c++:
Thanks for the help


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

Indeed, default mode != Standard conforming.
So you say that the warning is not caused by some error of mine
and it should not issue the warning?

Yup.


Rob.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top