Symbols from Linked Shared Libraries missing from the executable in a certain scenario.

Symbols from Linked Shared Libraries missing from the executable in a certain scenario.

Post by Gayatri Deshpan » Wed, 18 Jun 2003 15:18:26



Hi Guys...

Recently I built an executable on Solaris & Linux, linking into it a
thirdparty *.so. I copied the shared lib to the path where the
executable is stored & added the path to PATH & LD_LIBRARY_PATH.

When I run the executable from this directory, the executable loads
properly. When I see the shared lib dependancies using ldd, I am able
to spot the shared lib in question.

Now I go one directory level up & try loading the exe, it loads again.
An 'ldd exe' show the dependencies all right & a 'which exe' & 'which
sharedlib' shows that the correct exe & sharedlib are found.

One more level up & the problem begins. The same exe gives undefined
symbol error while loading. The trace of the third party lib vanishes
from 'ldd exe', though a 'which exe' & 'which sharedlib' still locates
the same exe I built & the sharedlib.

I tried logging in a various users & I can load the exe alright after
setting the paths.

Any idea as to what could be going wrong here only in the case of a
particular directory?

Thanks in Advance,
Gayatri.

 
 
 

Symbols from Linked Shared Libraries missing from the executable in a certain scenario.

Post by Chuck Dillo » Thu, 19 Jun 2003 02:10:14



> Now I go one directory level up & try loading the exe, it loads again.
> An 'ldd exe' show the dependencies all right & a 'which exe' & 'which
> sharedlib' shows that the correct exe & sharedlib are found.

Try using the -s switch of ldd (on solaris) to diagnose the problem.

-- ced

--
Chuck Dillon
Senior Software Engineer
NimbleGen Systems Inc.

 
 
 

Symbols from Linked Shared Libraries missing from the executable in a certain scenario.

Post by Gayatri Deshpan » Wed, 02 Jul 2003 19:32:47


Quote:> GD> I tried logging in a various users & I can load the exe alright after
> GD> setting the paths.

> GD> Any idea as to what could be going wrong here only in the case of a
> GD> particular directory?

> ND> If it only happens in one directory, the first question is:  what's
> ND> in it?

Well the problem was straightforeward - the directory did contain a
library which was an older version. what probably put me off the track
was ldd; why did ldd dump different information in this directory
only, when all the while it was referring to the same executable with
different relative paths each time.

Thanks a lot for your help.
Regards,
Gayatri.

 
 
 

1. Question: Inclusion of shared libraries during linking of shared libraries

Hi,

I am compiling a dynamic loadable library (*.so) under Unix (I'm working
under Solaris, but I guess my question applies to other Unix versions also).
This library requires other .so libraries to function. Now there are 2 ways
I can deal with this:

1.    Include the header files of the included library during compilation.
Do _not_ include the included library during linking, or
2.    Include the header files of the included library during compilation,
_and_ include the included library during linking.

Both of these work. When doing ldd on the 1st and the 2nd approach, I can
see that in the 2nd case the included libraries are required.

Can anyone tell me the pros and cons of either method? What is the preferred
way of doing this?

--
Pieter Winter
C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-IAQ: http://www.plethora.net/~seebs/faqs/c-iaq.html

2. unix/linux sockets

3. ld shared library linking -- symbol not found: fstat

4. Compaq SCSI Drive / LILO Install

5. undefined symbol itoa when linking shared library to -lm and -lc

6. 2.5.19 -- 2 OOPSen during boot process.

7. Problems linking static library on executable and static library

8. HELP! cannot log in to my solaris 8 with normal usernames

9. How to link an executable with undefined symbols

10. link static libraries into a shared library

11. command to list symbols in an executable or shared lib

12. Problem linking a C++ shared object and C executable

13. dynamically linked libraries from executable?