[Top][All Lists]

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

Re: g++ linking problem

From: Brian Dessent
Subject: Re: g++ linking problem
Date: Sun, 04 Jun 2006 10:35:38 -0700

S3 wrote:

> I see other messages similar to this in the mailing list,
> but I don't see any resolution yet.
> I am having a problem linking C++ programs.
> (I have attached the logs from compiling MySQL and KDE arts.)
> The programs compile just fine, but when it tries to link
> them, it fails to find all basic C++ symbols, such as those
> from libstdc++.  I have libstdc++-v3 installed.
> When I use g++ ordinarily, it links to libstdc++ just fine.
> Specifically, it can't find:
> __cxa_pure_virtual
> std::basic_string

This is usually caused by the user trying to link by invoking gcc
instead of g++ when C++ code is involved.  If you link with g++ it knows
to include all the necessary flags and options to support C++, which
does not happen when invoked as gcc.  However, in your case, libtool is
being used which adds another layer of indirection on top of things.

Unfortunately your configuration (or perhaps the package itself) is
invoking "libtool --silent", which means that the libtool wrapper isn't
printing the actual command that it's executing, which means those tens
of thousands of lines of spew you attached are more or less useless for
determining the actual problem.  You could have saved everybody reading
a lot of time by just incluing the the part that causes the error, which

/bin/sh ../libtool --silent --tag=CXX --mode=link g++  -Wno-long-long
-Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align
-Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG
-DNO_DEBUG -O2 -march=pentium4 -O2 -pipe -fomit-frame-pointer -mmmx
-msse2 -fstack-protector -Wformat-security -Wmissing-format-attribute
-Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common 
-ftemplate-depth-99    -o -rpath /usr/kde/3.5/lib
-no-undefined -Wl,--no-undefined -Wl,--allow-shlib-undefined
-version-info 1:0  -L/usr/kde/3.5/lib -L/usr/qt/3/lib -L/usr/lib  [many
.lo files]  -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0  
.libs/buffer.o: In function
std::char_traits<char>, std::allocator<char> >&)': undefined reference to `std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::assign(char const*,
unsigned int)'

In any case, this is not the right list to post on.  I suggest you post
this to the libtool list (CC:d), or the mailing list of the package


reply via email to

[Prev in Thread] Current Thread [Next in Thread]