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

C++/STL linking trouble



Greetings,

I'm having trouble with a new C++ package called Salomé which I can't
get to link to a C++ library in a new package OpenCASCADE.

Here's the error:

g++ -m64 -D_OCC64 -g -D_DEBUG_ -Wno-deprecated -Wparentheses -Wreturn-type -Wunused -o .libs/testDS testDS-testDS.o  -pthread ./.libs/libSalomeDSImpl.so /home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/HDFPersist/.libs/libSalomeHDFPersist.so -L/usr/lib -L/usr/lib/openmpi/lib -L/usr/X11R6/lib64 ../HDFPersist/.libs/libSalomeHDFPersist.so /usr/lib/libTKStdSchema.so /usr/lib/libTKPCAF.so /usr/lib/libTKCAF.so /usr/lib/libTKV3d.so /usr/lib/libTKMesh.so /usr/lib/libTKV2d.so /usr/lib/libTKService.so -lXt -lX11 /usr/lib/libTKHLR.so /usr/lib/libTKStdLSchema.so /usr/lib/libTKPLCAF.so /usr/lib/libTKLCAF.so /usr/lib/libTKTopAlgo.so /usr/lib/libTKGeomAlgo.so /usr/lib/libTKShapeSchema.so /usr/lib/libTKPShape.so /usr/lib/libTKBRep.so /usr/lib/libTKGeomBase.so /usr/lib/libTKG3d.so /usr/lib/libPTKernel.so /usr/lib/libTKG2d.so /usr/lib/libTKMath.so /usr/lib/libTKCDF.so /usr/lib/libTKernel.so -lstlport -lieee /usr/lib/libhdf5.so -lpthread -lz -lXmu -lnsl -lm -lrt -ldl -Wl,--rpath -Wl,/usr/lib64/salome -Wl,--rpath -Wl,/usr/lib
testDS-testDS.o: In function `main':
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:64: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)'
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:66: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)'
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:69: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)'
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:71: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_ExtendedString const&)'
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:73: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)'
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:73: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)'
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:78: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)'
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:80: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)'
/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:80: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)'
testDS-testDS.o:/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl/testDS.cxx:81: more undefined references to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, TCollection_AsciiString const&)' follow
./.libs/libSalomeDSImpl.so: undefined reference to `TDF_Attribute::ExtendedDump(std::basic_ostream<char, std::char_traits<char> >&, TDF_IDFilter const&, TDF_AttributeIndexedMap&) const'
./.libs/libSalomeDSImpl.so: undefined reference to `Standard_Transient::ShallowDump(std::basic_ostream<char, std::char_traits<char> >&) const'
./.libs/libSalomeDSImpl.so: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, Handle_Standard_Type const&)'
./.libs/libSalomeDSImpl.so: undefined reference to `TDF_Attribute::Dump(std::basic_ostream<char, std::char_traits<char> >&) const'
collect2: ld returned 1 exit status
make[2]: *** [testDS] Error 1
make[2]: Leaving directory `/home/hazelsct/salome-3.2.6/KERNEL_SRC_3.2.6/src/SALOMEDSImpl'

The libraries libTKPCAF, libTCAF, libTKernel etc. are part of the
OpenCASCADE package, which I haven't uploaded yet, but you can get from
http://lyre.mit.edu/~powell/opencascade/ (signed with my key in the
Debian keyring).  -4 is missing a build-dep on libmesa-gl1-dev, -5 will
be up soon.  The package I'm trying to build is Salomé, for which I've
put very preliminary -1 sources in http://lyre.mit.edu/~powell/salome/ .

To make matters worse, the Salomé build doesn't get this far in unstable
because of an incompatibility between omniorb4 4.0.6 and 4.1.1, so to
see the above error you need to build it against omniorb4 4.0.6 which is
in testing.  I've emailed the omniorb4 maintainers to ask for help with
making that part work.  Oh -- and building Salomé at all requires
patches to HDF5 and OpenMPI which I put in bugs 457080 and 459642 and
which the maintainers have agreed to merge.  The necessary HDF5 packages
are in the http://lyre.mit.edu/~powell/hdf5/ , and for OpenMPI, do
"ln -s libmpi_cxx.so /usr/lib/libmpi++.so" and Salomé will configure and
build properly.

Using nm -C I found that the library libTKernel has:
0000000000004c74 T operator<<(_STL::basic_ostream<char, _STL::char_traits<char> >&, TCollection_AsciiString const&)
and the other missing symbols are in that and other OpenCASCADE libs
with s/std/_STL/ .

>From Googling around, I've learned that this seems to be a confusion
between the stlport namespace and standard C++ library namespace for the
argument symbols.  So how do I either get Salomé to build in the stlport
namespace, or get OpenCASCADE to not build there?

Thanks for any help you can provide.  Please CC me in replies.

-Adam
-- 
GPG fingerprint: D54D 1AEE B11C CE9B A02B  C5DD 526F 01E8 564E E4B6

Engineering consulting with open source tools
http://www.opennovation.com/


Reply to: