GNOME Bugzilla – Bug 303936
should use g++ to link with cpp code
Last modified: 2005-05-13 22:05:36 UTC
Building with gcc-4.0 and g++-3.3 "cc -shared .libs/libgsttrm_la-gsttrm.o -L/usr/lib -pthread /usr/lib/libgstreamer-0.8.so -lmusicbrainz -lstdc++ -lm -Wl,--export-dynamic -Wl,-soname -Wl,libgsttrm.so -Wl,-version-script -Wl,.libs/libgsttrm.ver -o .libs/libgsttrm.so /usr/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status make[3]: *** [libgsttrm.la] Error 1" according to a discussion, with a Debian/Ubuntu maintainer, on IRC: "The problem is you're using "gcc -lstdc++" which is a) wrong, and b) won't work when gcc and g++ are mismatched (as they currently are in breezy, 4.0 versus 3.3) ... If they're pure C applications linking with C++ libs, link with g++."
This is a problem with libtool, although one with a simple workaround. One can create an empty file (don't forget the copyright header) called intentionall-left-blank.c++, add it to libgsttrm_la_SOURCES, and it then links with g++.
2005-05-13 Tim-Philipp Müller <tim at centricular dot net> * ext/musicbrainz/Makefile.am: * ext/musicbrainz/blank-file.cpp: Add empty .cpp file to make libtool use g++ for the linking instead of gcc (fixes #303936).