all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* In emacs, gdb says "cannot open shared object file"
@ 2009-05-31 16:18 Mihai Vasilian
  2009-06-01  5:19 ` Nick Roberts
  0 siblings, 1 reply; 4+ messages in thread
From: Mihai Vasilian @ 2009-05-31 16:18 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 851 bytes --]

Hi all,
I ran into a problem recently with emacs and gdb, and right now I am looking
for some help, posting here.
I compiled one program and one shared library in their coresponding
$MYPATH/prg/src and $MYPATH/misc/src folders.
I set in ~/.bashrc the variable LD_LIBRARY_PATH to point to $MYPATH/misc/src
folder where libmisc.so is saved.
I open console and run:  gdb prg    and everything goes fine.
I started to work with emacs recently and I go with: M-x gdb , gdb prg  ,
and then break main, and run.
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
If this (my fist post) on list is not the appropiate thing to find a
solution to my problem, please advice.
vmihai.

[-- Attachment #2: Type: text/html, Size: 893 bytes --]

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

* In emacs, gdb says "cannot open shared object file"
  2009-05-31 16:18 In emacs, gdb says "cannot open shared object file" Mihai Vasilian
@ 2009-06-01  5:19 ` Nick Roberts
  2009-06-01  9:13   ` Mihai Vasilian
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Roberts @ 2009-06-01  5:19 UTC (permalink / raw)
  To: Mihai Vasilian; +Cc: help-gnu-emacs

 > 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




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

* Re: In emacs, gdb says "cannot open shared object file"
  2009-06-01  5:19 ` Nick Roberts
@ 2009-06-01  9:13   ` Mihai Vasilian
  2009-06-02  7:14     ` Alberto Luaces
  0 siblings, 1 reply; 4+ messages in thread
From: Mihai Vasilian @ 2009-06-01  9:13 UTC (permalink / raw)
  To: Nick Roberts; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

2009/6/1 Nick Roberts <nickrob@snap.net.nz>

>  > 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 <http://www.inet.net.nz/%7Enickrob>


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.

[-- Attachment #2: Type: text/html, Size: 1738 bytes --]

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

* Re: In emacs, gdb says "cannot open shared object file"
  2009-06-01  9:13   ` Mihai Vasilian
@ 2009-06-02  7:14     ` Alberto Luaces
  0 siblings, 0 replies; 4+ messages in thread
From: Alberto Luaces @ 2009-06-02  7:14 UTC (permalink / raw)
  To: help-gnu-emacs

El Lunes 01 Junio 2009ES 11:13:12 Mihai Vasilian escribió:
> I see now it was a gdb issue, not an emacs or kdevelop one.

If you need to set this or some other environment variables, you can also use 
the "set environment" command from gdb:

set environment FOO=foo

Regards,

Alberto




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

end of thread, other threads:[~2009-06-02  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-31 16:18 In emacs, gdb says "cannot open shared object file" Mihai Vasilian
2009-06-01  5:19 ` Nick Roberts
2009-06-01  9:13   ` Mihai Vasilian
2009-06-02  7:14     ` Alberto Luaces

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.