🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Peter Van Osta Tue, 08 Oct 2002 09:46
.so problem and crossreferences between libraries in C, Linux
#938
Author: Peter Van Osta
Date: Tue, 08 Oct 2002 09:46
58 lines
2906 bytes
Hi,

I am having serious trouble with linking shared objects (.so files) and
crossreferencing between libraries. If you could respond by email
(remove _NOSPAM from address) ?

Shared object problem:
----------------------
Creating qaz...
/home/mcube/lib/Linux/libqwe.so: file not recognized: File format not
recognized
collect2: ld returned 1 exit status
make: *** [qaz] Error 1

I compile the libraries to ".a" files and use these files at the momnet
as I cannot use the ".so" files. Using the ".a" files works. The only
information i ahve is that there isa difference in the fact that our new
".so" files are "stripped":

".so" files of our software:
libqwe.so: ELF 32-bit LSB shared object, Intel 80386, version 1,
stripped
libcbpim21.so: ELF 32-bit LSB shared object, Intel 80386, version 1, not
stripped

Version information:
ld -v geeft:
GNU ld version 2.11.90.0.8 (with BFD 2.11.90.0.8)

gcc -v gives:
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)

ranlib -v gives:
GNU ranlib 2.11.90.0.8

uname -a gives:
Linux linux-1 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown

Crossreferencing between libraries:
-----------------------------------

I have some libraries that depend on functions in other libraries, so
they are not "self-contained". I tried to follow the advce to change the
order in which they are linked, but that doens't seem to work. What can
I do to solve this problem ?

Info:

/home/abc/lib/Linux/libsrty.so: undefined reference to `test_dir'
/home/abc/lib/Linux/libsrty.so: undefined reference to `make_dir'
collect2: ld returned 1 exit status
make: *** [qaz_02] Error 1

Thanks in advance,

Peter

http://ourworld.compuserve.com/homepages/pvosta/
Re: .so problem and crossreferences between libraries in C, Linux
#939
Author: joe durusau
Date: Tue, 08 Oct 2002 10:34
71 lines
3408 bytes

Peter Van Osta wrote:

> Hi,
>
> I am having serious trouble with linking shared objects (.so files) and
> crossreferencing between libraries. If you could respond by email
> (remove _NOSPAM from address) ?
>
> Shared object problem:
> ----------------------
> Creating qaz...
> /home/mcube/lib/Linux/libqwe.so: file not recognized: File format not
> recognized
> collect2: ld returned 1 exit status
> make: *** [qaz] Error 1
>
> I compile the libraries to ".a" files and use these files at the momnet
> as I cannot use the ".so" files. Using the ".a" files works. The only
> information i ahve is that there isa difference in the fact that our new
> ".so" files are "stripped":
>
> ".so" files of our software:
> libqwe.so: ELF 32-bit LSB shared object, Intel 80386, version 1,
> stripped
> libcbpim21.so: ELF 32-bit LSB shared object, Intel 80386, version 1, not
> stripped
>
> Version information:
> ld -v geeft:
> GNU ld version 2.11.90.0.8 (with BFD 2.11.90.0.8)
>
> gcc -v gives:
> gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)
>
> ranlib -v gives:
> GNU ranlib 2.11.90.0.8
>
> uname -a gives:
> Linux linux-1 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown
>
> Crossreferencing between libraries:
> -----------------------------------
>
> I have some libraries that depend on functions in other libraries, so
> they are not "self-contained". I tried to follow the advce to change the
> order in which they are linked, but that doens't seem to work. What can
> I do to solve this problem ?
>
> Info:
>
> /home/abc/lib/Linux/libsrty.so: undefined reference to `test_dir'
> /home/abc/lib/Linux/libsrty.so: undefined reference to `make_dir'
> collect2: ld returned 1 exit status
> make: *** [qaz_02] Error 1
>
> Thanks in advance,
>
> Peter
>
> http://ourworld.compuserve.com/homepages/pvosta/

The best solution is to remove all non-selfcontained functions/libs.
It is a terrible idea to have libfoo use something in libbar, while
libbar also uses something in libfoo.  See the ld docs if you really
can't  find a way to reprogram around this situation.

Speaking only for myself,

Joe Durusau
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads