[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C++/STL linking trouble



On Wed, 2008-01-09 at 17:30 -0500, Adam C Powell IV wrote:
<snip>
> I think I found the problem.  I pre-processed two files in question,
> TDF_Attribute.cxx in OpenCASCADE and testDS.cxx in Salomé.  I put both
> outputs in http://lyre.mit.edu/~powell/salome/
> 
> In the former, /usr/include/stlport/stl/_iosfwd.h opens a "namespace
> _STL {" then #includes /usr/include/stlport/stl/_iosfwd.h which has:
> typedef basic_ostream<char, char_traits<char> > ostream; (line 2685)
> 
> In the latter, /usr/include/c++/4.2/iosfwd opens a
> "namespace std __attribute__ ((__visibility__ ("default"))) {" then
> #includes /usr/include/c++/4.2/iosfwd which has:
> typedef basic_ostream<char> ostream; (line 6311)
> 
> So they lead to different symbols, which breaks linking.  What to do?

Don't try to "fix" this by making STLport use namespace std; it is not
binary-compatible with libstdc++, which is why it uses a different
namespace.  You must use the same implementation (libraries and headers)
in both Salomé and OpenCASCADE.  This should probably be libstdc++; so
far as I know there is little reason to use STLport with g++ today.  You
should probably investigate how one of these packages is configured to
use STLport and the other doesn't.

Ben.

-- 
Ben Hutchings
If God had intended Man to program,
we'd have been born with serial I/O ports.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: