public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* `GLIBCXX_3.4.9' not found
@ 2008-07-10 19:47 Herbert Saal
  2008-07-10 22:36 ` Brian Dessent
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Saal @ 2008-07-10 19:47 UTC (permalink / raw)
  To: gcc-help


Hello,

I get the following result when i ldd my shared library in a target computer:

$> ldd /usr/lib/libCVTJavaInterface.so
/usr/lib/libCVTJavaInterface.so:
/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by
/usr/lib/libCVTJavaInterface.so)
    linux-gate.so.1 =>  (0xffffe000)
    libcvt.so => /usr/lib/libcvt.so (0xb7e95000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7dab000)
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7d84000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7d78000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7c37000)
    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7c33000)
    /lib/ld-linux.so.2 (0x80000000)


I have the following files in the target computer:
lrwxrwxrwx 1 root root     18 2007-10-17 10:00 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.8
-rw-r--r-- 1 root root 929648 2007-03-02 21:51 /usr/lib/libstdc++.so.6.0.8

I have the following files in my development computer:
gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
 /usr/lib/libstdc++.so.5 -> libstdc++.so.5.0.7
 /usr/lib/libstdc++.so.5.0.7
 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.9
 /usr/lib/libstdc++.so.6.0.9

What can i do?

One option i think is to static compile the libstdc++ library in my shared library. what is the instruction to do that?

thanks in advance,
Herbert

_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: `GLIBCXX_3.4.9' not found
  2008-07-10 19:47 `GLIBCXX_3.4.9' not found Herbert Saal
@ 2008-07-10 22:36 ` Brian Dessent
  2008-07-11 15:47   ` Herbert Saal
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Dessent @ 2008-07-10 22:36 UTC (permalink / raw)
  To: Herbert Saal; +Cc: gcc-help

Herbert Saal wrote:

> What can i do?

With symbol versioning, compatibility works backwords but not forwards
-- a binary built against an older libstdc++ should normally function
correctly with a newer libstdc++ found on the machine at runtime.  Thus
the solution is to install the oldest version of gcc you wish to support
on your development machine and link with it.  This doesn't mean you
necessarily need to use this old version of gcc to develop with, as you
can have as many versions installed on the machine as you want.  Just
use the old version to produce the final binary.

> One option i think is to static compile the libstdc++ library in my shared library. what is the instruction to do that?

That's a very bad idea.  Static linking works well for programs, but for
a shared library it's going to be a nightmare because it means your lib
will be loaded into a program that is likely dynamically linked against
some other version of libstdc++.  Thus you get essentially two copies of
libstdc++ code, and if you try to pass objects between your code in your
shared library and the code in the main program you have to ensure that
all data structures are laid out exactly the same or compatible,
otherwise you get random crashes or other unexplainable behavior.  In
other words, this solves nothing but just makes the problem ten times
harder to debug.  Not to mention the practical issue that the code in
the static libstdc++ archive is not built PIC and so you can't link it
into a shared library (the exception being i386, where it's allowed but
with a performance penalty of relocs that make your text section
non-sharable so what's the point.)

Brian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: `GLIBCXX_3.4.9' not found
  2008-07-10 22:36 ` Brian Dessent
@ 2008-07-11 15:47   ` Herbert Saal
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Saal @ 2008-07-11 15:47 UTC (permalink / raw)
  To: gcc-help


Brian,

thank you very much, for your soon response.

regards,
Herbert

> Date: Thu, 10 Jul 2008 12:45:27 -0700
> From: brian@dessent.net
> To: herbertsg@hotmail.com
> CC: gcc-help@gcc.gnu.org
> Subject: Re: `GLIBCXX_3.4.9' not found
>
> Herbert Saal wrote:
>
>> What can i do?
>
> With symbol versioning, compatibility works backwords but not forwards
> -- a binary built against an older libstdc++ should normally function
> correctly with a newer libstdc++ found on the machine at runtime. Thus
> the solution is to install the oldest version of gcc you wish to support
> on your development machine and link with it. This doesn't mean you
> necessarily need to use this old version of gcc to develop with, as you
> can have as many versions installed on the machine as you want. Just
> use the old version to produce the final binary.
>
>> One option i think is to static compile the libstdc++ library in my shared library. what is the instruction to do that?
>
> That's a very bad idea. Static linking works well for programs, but for
> a shared library it's going to be a nightmare because it means your lib
> will be loaded into a program that is likely dynamically linked against
> some other version of libstdc++. Thus you get essentially two copies of
> libstdc++ code, and if you try to pass objects between your code in your
> shared library and the code in the main program you have to ensure that
> all data structures are laid out exactly the same or compatible,
> otherwise you get random crashes or other unexplainable behavior. In
> other words, this solves nothing but just makes the problem ten times
> harder to debug. Not to mention the practical issue that the code in
> the static libstdc++ archive is not built PIC and so you can't link it
> into a shared library (the exception being i386, where it's allowed but
> with a performance penalty of relocs that make your text section
> non-sharable so what's the point.)
>
> Brian

_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-11 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-10 19:47 `GLIBCXX_3.4.9' not found Herbert Saal
2008-07-10 22:36 ` Brian Dessent
2008-07-11 15:47   ` Herbert Saal

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).