public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Brian Dessent <brian@dessent.net>
To: S3 <stein@ir.iit.edu>
Cc: gcc-help@gcc.gnu.org, libtool@gnu.org
Subject: Re: g++ linking problem
Date: Sun, 04 Jun 2006 17:35:00 -0000	[thread overview]
Message-ID: <448319EA.C56CB0E2@dessent.net> (raw)
In-Reply-To: <4482EAC0.8060608@ir.iit.edu>

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
was:

/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 libmcop.la -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  
../libltdl/libltdlc.la 
.libs/buffer.o: In function
`Arts::Buffer::readString(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)':
buffer.cc:(.text+0x6c1): 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
itself.

Brian

      reply	other threads:[~2006-06-04 17:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-04 14:14 S3
2006-06-04 17:35 ` Brian Dessent [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=448319EA.C56CB0E2@dessent.net \
    --to=brian@dessent.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=libtool@gnu.org \
    --cc=stein@ir.iit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).