LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-05-2012, 10:01 PM   #1
vicku
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
error while loading shared libraries


Hi, all,
I was trying to run a c++ program. Because I don't have root permission to install Boost C++ library, I installed it under my home local directory: /home/username/boost. The boost version I installed is boost_1_49_0. There is a .bashrc file under /home/username/ directory, I made the following settings to this .bashrc file:
export LD_LIBRARY_PATH=/home/username/boost/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=/home/username/boost/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=/home/username/boost/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/home/username/boost/include:$CPLUS_INCLUDE_PATH

There was a makefile, so when compiling, I used:
make -l/home/username/boost/lib

but there is an error when run the main: error while loading shared libraries: libboost_program_options.so.1.42.0: cannot open shared object file: No such file or directory

I also tried to run: export LD_LIBRARY_PATH=/home/username/boost/stage/lib, but it didn't work.
I am quite a newbie, does anyone can help me?

Thanks a lot.

Last edited by vicku; 07-05-2012 at 10:34 PM.
 
Old 07-06-2012, 02:25 AM   #2
pradiptart
Member
 
Registered: Sep 2007
Posts: 102

Rep: Reputation: 12
Hi,

I don't know what you have in make file.Give a snap of your make file to be more clear of the question.

try this: In make file use -L(capital) in place of -l(small) to give the linker ,where to search for the libraries during runtime.

examle:
gcc -L/home/username/boost/lib <cpp file>

Thanks

Last edited by pradiptart; 07-06-2012 at 02:29 AM.
 
1 members found this post helpful.
Old 07-06-2012, 09:03 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
You said that it's looking for libboost_program_options.so.1.42.0. Is this the exact library-version that is installed in the local directory?

Your program's request for the library is apparently as specific as a request can be: "version 1.42.0, please." No other version will satisfy such a request.
 
1 members found this post helpful.
Old 07-06-2012, 02:56 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
perhaps creating a symbolic link with the desired name of the library to the one you actually have in your system could wrap it up without breaking a lot of stuff.
 
  


Reply



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: libcrypt.so.1: cannot open shared object file: xmixail Linux - Kernel 15 07-29-2012 08:39 PM
honeyd: error while loading shared libraries: libdnet.1: cannot open shared object fi secbuddy Linux - Software 2 12-24-2011 02:01 PM
error while loading shared libraries: libtermcap.so.2: cannot open shared object file astroboy2000ir Linux - Software 3 12-07-2010 11:16 PM
top: error while loading shared libraries: libproc.so.2.0.6: cannot open shared objec ramesh_india2020 Linux - Server 1 07-29-2010 12:52 PM
error while loading shared libraries: libstdc++.so.5: cannot open shared object file PaulyWally Debian 2 10-18-2008 05:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:53 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
Open Source Consulting | Domain Registration