LinuxQuestions.org
Review your favorite Linux distribution.
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 08-26-2009, 01:16 AM   #1
vipulspn
LQ Newbie
 
Registered: Aug 2009
Posts: 11

Rep: Reputation: 0
Unable to load a shared library


Hi,

I am working on an application that links to library libX.so and libY.so. libX.so has some undefined symbols which are defined in libY.so. Compiling the application is fine.
But during runtime libX.so fails to load with an error like:

Failed to load dynameic library libX. /data/Installs/vip2/libX.so: undefined symbol: _ZN10App7Schemas3Soa8_2006_0310Exceptions12SoaException10setMessageERKSs

If this symbol was not found how did application get compile and why is this cribbing now at run time? Any help on this?

Thanks,
Vipul
 
Old 08-26-2009, 01:28 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Clearly, you need to make sure both shared libraries, libX.so and libY.so, are installed and accessible on your system.

They do *not* need to be located in the same place at runtime as they existed at link time (although this is usually the case).

Please do this:
1. run "ldd PGMNAME" on the executable that needs these two shared libraries.

You can also run "ldd SHOBNAME" on any shared library (to find its runtime dependencies).

2. Copy both libraries to your system (if they're not already there)

3. Define and export "LD_LIBRARY_PATH" (if one or more of your libraries happens to exist in a location different from where "ldd")

4. You should be able to Google for "linux shared library ldd LD_LIBRARY_PATH" for more information, if it's not clear what I'm trying to say.

This problem should be pretty easy to resolve - Good luck!

Sincerely .. PSM
 
Old 08-26-2009, 03:19 AM   #3
vipulspn
LQ Newbie
 
Registered: Aug 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for the reply Paul.
I am still struggling with the issue.

1. The libraries are loaded at runtime.
2. Both the libraries are in place (LD_LIBRARY_PATH out of ques). There are other libraries as well which are being loaded properly from the location. I have execute permission on both libX and libY.

Anything else i can try out?

-Vipul
 
Old 08-26-2009, 03:24 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
What is the output of the ldd commands? See point 1 in the post by paulsm4 above.
 
Old 08-26-2009, 06:20 AM   #5
vipulspn
LQ Newbie
 
Registered: Aug 2009
Posts: 11

Original Poster
Rep: Reputation: 0
The ldd on application's exe does not show dependency on libX and libY. So I think that they are being dynamically loaded.
 
Old 08-26-2009, 06:24 AM   #6
vipulspn
LQ Newbie
 
Registered: Aug 2009
Posts: 11

Original Poster
Rep: Reputation: 0
By this I mean that libraries are not statically linked with the exe.
 
Old 08-26-2009, 06:42 AM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
But then they *should* show up if/when you query the executable
using ldd ... that's what ldd does, showing which dynamic libs
the executable was compiled against.



Cheers,
Tink
 
Old 08-26-2009, 07:29 AM   #8
vipulspn
LQ Newbie
 
Registered: Aug 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Now i tried to put -lX in the compiler option and made application working. I did this because I thought that some symbol is undefined, why not statically link this library to the application (I my understanding that this way I am doing static linking is correct)? I went for it it works.
But why did is it not working without this is the real question I am chasing.
 
  


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
unable to step through function in shared object library using gdb markhod Programming 2 01-03-2009 02:00 AM
error:25066067:DSO support routines :DLFCN_LOAD:could not load the shared library berserker-ky Linux - Wireless Networking 1 02-20-2006 10:20 PM
PHP Warning: Unable to load dynamic library xbaez Linux - Software 3 02-15-2005 06:11 PM
my slack can't load shared library AnhTuan Slackware 6 10-03-2004 09:27 AM
shared object library won't load (libstdc++) sleepylight Linux - General 4 04-27-2004 04:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:40 PM.

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