From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <98016233404115.tru64-unix-managers.marc@archive.invalid> From: Arno Hahma Date: Mon, 22 Jan 2001 11:22:37 +0000 To: tru64-unix-managers Subject: How to link agains C++-compiled libraries? X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=98016233404115 Problem: ld doesn't find objects defined in C++ -compiled shared library. The problem is apparently, that the mangled names in the library are different than what ld thinks to look for. This may be because the software in question defines new C++ classes based on the ones present in the shared libraries. Then it tries to link the parent classes from the library, which doesn't seem to work. Is there a workaround for this other than linking statically? Example: gcc -L/usr/local/qt/lib -rpath /usr/local/qt/lib -o prog -lqt -lm Unresolved: QApplication::QApplication(int &, char **) QString::QString(char const *) QFileInfo::QFileInfo(QString const &) .. .. .. hundreds of lines of complaints. cxx complains about something different: ld: Unresolved: __4QDirRC7QStringT1ii __4QDirRC4QDir __as__4QDirRC4QDir _$_4QDir .. .. .. and hundreds of mangled names follow, regardless of, whether the were compiled with cxx or gcc. All symbols are defined libqt.so, if checked with nm. The compiler/OS versions are: Compaq C V6.3-129 (dtk) on Digital UNIX V4.0G (Rev. 1530) Compiler Driver V6.3-126 (dtk) cc Driver Compaq C++ V6.3-002 for Digital UNIX V4.0G (Rev. 1530) Compiler Driver V6.3-002 (cxx) cxx Driver gcc 2.95.2 ArNO 2