LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-23-2009, 06:39 AM   #1
mroost
LQ Newbie
 
Registered: Apr 2009
Location: London, UK
Posts: 2

Rep: Reputation: 0
symbolic links - error while loading shared libraries


I am trying to install the software gpsim. I have successfully (I think) configured, created the makefile and made the files necessary but now when I try and launch the application I get the error:
gpsim: error while loading shared libraries: libgpsim.so.0: cannot open shared object file: No such file or directory
I have established by use of the command:
locate libgpsim.so.0
(maybe sudo locate libgpsim.so.0
that this is present in the /usr/local/lib/ folder but not in the /usr/lib which it needs to be. To correct this a symbolic link can be used (to link the location the application is looking for with the actual file). To do this I have used the command:
ln -s /usr/local/lib/libgpsim.so.0 /usr/lib/libgpsim.so.0
(ln -s <file_location> <new_link_location>)

Now when I try and launch gpsim I there is the same issue with the file libgpsimcli.so.0 so I have done the same as above and now an issue with libgpsimgui.so.0

So, finally onto my question(s)
1). Have I unpacked/created this library in the wrong area i.e. not as root - is this why it is in the /usr/local/lib directory rather than /usr/lib/?
2). Is there a way of doing a bulk symbolic link or batch symbolic link so I can link all the libgpsim* library files in one go?

Apologies for the long post but I wanted to go through my steps in case anyone else has this issue rather than start half way through and skip the how to create a symbolic link.

Many thanks,
Mark

Last edited by mroost; 04-23-2009 at 06:42 AM. Reason: create generic command
 
Old 04-23-2009, 08:52 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,516

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
When you build a package from source (one that uses configure in the package source directory), the default behavior is to install in the /usr/local tree -- and this is a "good thing" because anything you install as an "extra" does not interfere with system software. You can, by using arguments to configure, install the package in /bin, /usr/bin, /usr/lib and so on, but it's usually a better idea to install in /usr/local (and there will be some arguments about this). The downside of this is that you may need to add path information to your system so it looks in /usr/local for libraries, executables and the like.

You can add /usr/local/lib to the LD_LIBRARY_PATH environment variable; system-wide, edit /etc/profile and, down toward the end of that file put
Code:
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
You must log out an log back in for this to take effect; /etc/profile is read once at log in.

If you prefer to have user-by-user, edit the .profile (Bourne, BASH or Korn shell), .bashrc (BASH) or .chsrc (C-shell) adding the above using the syntax appropriate for that shell; the example shown is for Bourne, BASH or Korn shells but not C-shell.

You should log out and log back in for the addition to take effect.

Consider, as a general rule, that you install additional software in the default /usr/local tree and that you install "package" software (such as OpenOffice.org) in /opt. Doing this keeps system software and add-on software segregated; you may need to add path information to your /etc/profile (or some other file; check your system documentation).

Hope this helps some.
 
Old 04-23-2009, 09:22 AM   #3
mroost
LQ Newbie
 
Registered: Apr 2009
Location: London, UK
Posts: 2

Original Poster
Rep: Reputation: 0
Talking

Hi tronayne

Thanks for your help. I've added the library path to the bash shell and the application gpsim is launching correctly.

Having looked at the contents of /usr/local/lib it would have quite time consuming had I continued down the path of creating symbolic links for all the library files.

Thanks again,
Mark
 
Old 04-23-2009, 09:32 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
You can add /usr/local/lib to /etc/ld.so.conf and then run "sudo /sbin/ldconfig". This will add libraries in /usr/local/lib to the list that `ld' searches.
 
Old 04-23-2009, 02:22 PM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,516

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
Quote:
You can add /usr/local/lib to /etc/ld.so.conf and then run "sudo /sbin/ldconfig". This will add libraries in /usr/local/lib to the list that `ld' searches.
...and that's the other way that I forgot to mention.
 
Old 07-22-2009, 03:02 PM   #6
pepegrillo
LQ Newbie
 
Registered: Jul 2009
Location: Medellin - Colombia
Distribution: openSuse 11.1
Posts: 4

Rep: Reputation: 0
Hello!

I had the same problem with gpsim-0.23, and the first solution described by tronayne work perfect. I decided to edit my .bashrc (in suse 11.1), and now my gpsim works without problems.

Thanks a lot.
 
Old 11-30-2009, 07:43 AM   #7
abhilashtabraham
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
i'm abhilash...i'm trying to install gpsim in my linux s/m....i successfully installed gputils and gtkextra...but on ./configure for gpsim, config error:gtkextra-20 package not found is coming..please help me sort hte problem....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: Franziss Linux - Newbie 10 06-28-2010 06:47 AM
Urgent !!! rpm: error while loading shared libraries: libelf.so.1: cannot open shared tinaa Linux - Software 5 12-02-2008 04:19 PM
gxine: error while loading shared libraries: libmozjs.so: cannot open shared object.. khronosschoty Slackware 10 11-10-2008 08:33 PM
error while loading shared libraries: libgvc.so.3: cannot open shared object file coolrock Slackware 6 01-17-2007 06:10 PM
any links on linking, loading shared libraries, shared objects. etc? ananthbv Programming 0 02-03-2005 08:47 AM


All times are GMT -5. The time now is 06:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration