From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mihai Vasilian Newsgroups: gmane.emacs.help Subject: Re: In emacs, gdb says "cannot open shared object file" Date: Mon, 1 Jun 2009 11:13:12 +0200 Message-ID: References: <18979.25818.810590.678739@totara.tehura.co.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6d59e1fef0d34046b45d561 X-Trace: ger.gmane.org 1243847977 5753 80.91.229.12 (1 Jun 2009 09:19:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jun 2009 09:19:37 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Nick Roberts Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 01 11:19:35 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MB3g3-0008Bk-97 for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Jun 2009 11:19:31 +0200 Original-Received: from localhost ([127.0.0.1]:35154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MB3g2-0006cb-AU for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Jun 2009 05:19:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MB3a6-0004gf-SI for help-gnu-emacs@gnu.org; Mon, 01 Jun 2009 05:13:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MB3a0-0004cd-Ts for help-gnu-emacs@gnu.org; Mon, 01 Jun 2009 05:13:22 -0400 Original-Received: from [199.232.76.173] (port=37790 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MB3a0-0004cN-Ds for help-gnu-emacs@gnu.org; Mon, 01 Jun 2009 05:13:16 -0400 Original-Received: from mail-bw0-f161.google.com ([209.85.218.161]:34781) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MB3Zz-0005me-Jo for help-gnu-emacs@gnu.org; Mon, 01 Jun 2009 05:13:16 -0400 Original-Received: by bwz5 with SMTP id 5so8136580bwz.42 for ; Mon, 01 Jun 2009 02:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=tzCm+uJiLbcmzuJEhdYnrk/ctX7iog8DDaPGxQvdZ20=; b=u3Kk10iWTnNbX6vQJqPd8KfRLAmT9BCpQ60cYZsXyMiu8dEQo1D70V4aDs+ZK+lPv4 vLLcti1FmgI4WJcoe4NmFIbvsbrX/jFkRoj8KS0zcTd5Xvp0PQ1/vmNuLFNz3d0GIk2T s6JgtdevC2vtzUAD6uMaxZiOKems1O2tMODRI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=uod/T+EwJuBxvfUZKIzYwWIqbPBZHDyTsqOKCQS0Ptfs26xMMgGMgtamxFobl6xNqk TtzmWm9YlcTb8V8S6OPqjpZcrDZHga0xy57s5LhShNkvZHVTdG9nefFq+ERXJz1cIXhN Ce2QrTSuKjykDhU7eqG/xSFgQQBwWLxp+OmTQ= Original-Received: by 10.204.119.71 with SMTP id y7mr5487378bkq.24.1243847592971; Mon, 01 Jun 2009 02:13:12 -0700 (PDT) In-Reply-To: <18979.25818.810590.678739@totara.tehura.co.nz> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64858 Archived-At: --0016e6d59e1fef0d34046b45d561 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/6/1 Nick Roberts > > I get the following error message: > > Starting program: /mnt/sda5/Programming/prg/src/prg > > /mnt/sda5/Programming/prg/src/prg: error while loading shared libraries: > > libmisc.so: cannot open shared object file: No such file or directory > > It doesn't sound like in Emacs problem. Does > > ldd /mnt/sda5/Programming/prg/src/prg > > find libmisc.so? > > What happens if you run gdb from the command line? If you start Emacs from > the desktop, LD_LIBRARY_PATH might not be set. > > $MYPATH/prg/src and $MYPATH/misc/src look like src folders. It's usual to > to put executables and shared objects in bin and lib directories > respectively. > > -- > Nick > http://www.inet.net.nz/~nickrob With LD_LIBRARY_PATH set in ~/.bashrc , gdb was loading misc library when started from console. However when started from emacs , as well as from kdevelop, it was not loading misc I solved it by adding to my .gdbinit set solib-search-path /mnt/sda5/Programming/misc/src It works also if I add to my prg's Makefile g++ .... -lmisc -Wl,-rpath=/mnt/sda5/Programming/misc/src I see now it was a gdb issue, not an emacs or kdevelop one. Thanks again. --0016e6d59e1fef0d34046b45d561 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2009/6/1 Nick Roberts <nickrob@snap.net.nz>
=A0> I get the following error message:
=A0> Starting program: /mnt/sda5/Programming/prg/src/prg
=A0> /mnt/sda5/Programming/prg/src/prg: error while loading shared libra= ries:
=A0> libmisc.so: cannot open shared object file: No such file or directo= ry

It doesn't sound like in Emacs problem. =A0Does

ldd /mnt/sda5/Programming/prg/src/prg

find libmisc.so?

What happens if you run gdb from the command line? =A0If you start Emacs fr= om
the desktop, LD_LIBRARY_PATH might not be set.

$MYPATH/prg/src and $MYPATH/misc/src look like src folders. =A0It's usu= al to
to put executables and shared objects in bin and lib directories respective= ly.

--
Nick =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 http://www.inet.net.nz/~nickrob

With L= D_LIBRARY_PATH set in ~/.bashrc=A0=A0 , gdb was loading misc library when s= tarted from console.
However when started from emacs , as well as from kdevelop, it was not load= ing misc

I solved it by adding to my .gdbinit
set solib-search-path /mnt/sda5/Programming/misc/src

It works also if I add to my prg's Makefile
g++ ....=A0 -lmisc -Wl,-rpath=3D/mnt/sda5/Programming/misc/src

I see= now it was a gdb issue, not an emacs or kdevelop one.
Thanks again.
=
--0016e6d59e1fef0d34046b45d561--