From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7965 invoked by alias); 30 Apr 2012 17:28:20 -0000 Received: (qmail 7956 invoked by uid 22791); 30 Apr 2012 17:28:18 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-lb0-f175.google.com (HELO mail-lb0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Apr 2012 17:28:05 +0000 Received: by lbbgo4 with SMTP id go4so2196210lbb.20 for ; Mon, 30 Apr 2012 10:28:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.145.1 with SMTP id sq1mr20812483lab.22.1335806883293; Mon, 30 Apr 2012 10:28:03 -0700 (PDT) Received: by 10.112.59.230 with HTTP; Mon, 30 Apr 2012 10:28:03 -0700 (PDT) In-Reply-To: <4F9E881C.7000900@ameritech.net> References: <4F9E881C.7000900@ameritech.net> Date: Mon, 30 Apr 2012 17:28:00 -0000 Message-ID: Subject: Re: g++ libstdc++ linker question. From: Jonathan Wakely To: "F. Heitkamp" Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00316.txt.bz2 On 30 April 2012 13:39, F. Heitkamp wrote: > People will tell me to ask on matplotlib list but I believe this a more > generic GNU C++ question. > I have been trying to run matplotlib that I built from source on my linux > from scratch like box. > > When I try to run an example I get: > > bash-4.2$ python2.6 matplotlib-ex1.py > Traceback (most recent call last): > =A0File "matplotlib-ex1.py", line 13, in > =A0 =A0import matplotlib.pyplot as plt > =A0File "/usr/lib/python2.6/site-packages/matplotlib/pyplot.py", line 23,= in > > =A0 =A0from matplotlib.figure import Figure, figaspect > =A0File "/usr/lib/python2.6/site-packages/matplotlib/figure.py", line 16,= in > > =A0 =A0import artist > =A0File "/usr/lib/python2.6/site-packages/matplotlib/artist.py", line 6, = in > > =A0 =A0from transforms import Bbox, IdentityTransform, TransformedBbox, > TransformedPath > =A0File "/usr/lib/python2.6/site-packages/matplotlib/transforms.py", line= 34, > in > =A0 =A0from matplotlib._path import affine_transform > ImportError: /usr/lib/python2.6/site-packages/matplotlib/_path.so: undefi= ned > symbol: > _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PK= S3_i > > I see this symbol is in 32 bits libstdc++ library, but does not seem to > appear in 64 bits versions. Right, the equivalent symbol in the 64-bit lib ends in _l instead of _i > bash-4.2$ ldd /usr/lib/python2.6/site-packages/matplotlib/_path.so > =A0 =A0linux-gate.so.1 =3D> =A0(0xffffe000) > =A0 =A0libpython2.6.so.1.0 =3D> /usr/lib/libpython2.6.so.1.0 (0xf74f7000) > =A0 =A0libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0xf74de000) > =A0 =A0libpthread.so.0 =3D> /lib/libpthread.so.0 (0xf74c4000) > =A0 =A0libc.so.6 =3D> /lib/libc.so.6 (0xf7367000) > =A0 =A0libdl.so.2 =3D> /lib/libdl.so.2 (0xf7362000) > =A0 =A0libutil.so.1 =3D> /lib/libutil.so.1 (0xf735e000) > =A0 =A0libm.so.6 =3D> /lib/libm.so.6 (0xf7338000) > =A0 =A0/lib/ld-linux.so.2 (0xf77d1000) > > libstdc++ is not shown as being linked with _path.so > > Any thoughts? Is _path.so a 32-bit or 64-bit library? From the missing symbol I'm asuming 32-bit. It would appear it wasn't correctly linked, so its dependency on libstdc++.so isn't recorded in the library by a DT_NEEDED entry. Does it help if you tell the dynamic linker to preload libstdc++.so? LD_PRELOAD=3D/usr/lib/libstdc++.so python2.6 matplotlib-ex1.py