Edward Pilatowicz wrote:
> hey all,
>
> how do i link an application against a library with a non-standard name?
>
> for example, if i have a library called "foo_bar.so" i can't do:
> cc foo.c -o foo -lfoo_bar
>
> since the linker will always prepend the "lib" prefix and search for
> libfoo_bar.so.
>
> thanks
> ed
You can give it the entire name:
cyber% cat > hello.c
hello() { printf("hello, world\n");}
cyber% cc -o /tmp/hello.so.1 -G hello.c -Kpic -lc
cyber% cat > main.c
main() {hello();}
cyber% cc -o hello main.c /tmp/hello.so.1
cyber% ./hello
The -L and -R options seem restricted to libraries named
in the usual fashion.
cyber% dump -Lv ./hello
./hello:
**** DYNAMIC SECTION INFORMATION ****
.dynamic:
[INDEX] Tag Value
[1] NEEDED /tmp/hello.so.1
[2] NEEDED libc.so.1
[3] INIT 0x8050694
[4] FINI 0x80506a8
[5] HASH 0x80500e8
[6] STRTAB 0x805036c
[7] STRSZ 0x146
[8] SYMTAB 0x80501cc
[9] SYMENT 0x10
[10] CHECKSUM 0x4960
[11] VERNEED 0x80504b4
[12] VERNEEDNUM 0x1
[13] PLTSZ 0x28
[14] PLTREL 0x11
[15] JMPREL 0x80504ec
[16] REL 0x80504e4
[17] RELSZ 0x30
[18] RELENT 0x8
[19] DEBUG 0
[20] FEATURE_1 PARINIT
[21] FLAGS 0
[22] FLAGS_1 0
[23] PLTGOT 0x80606c0
cyber%
--
Bart Smaalders Solaris Kernel Performance
barts at cyber.eng.sun.com http://blogs.sun.com/barts