Where do the linker look for shared libraries?
Andreas Davour
ante at Update.UU.SE
Wed Mar 2 10:30:05 PST 2005
Hi!
I've tried to compile and link a small game written with the Allegro
API. For some odd reason the linker just don't understand how to resolve
the symbols in the library. It just can't accept that the library is in
a ".so" file and not an ".a" archive, and even when I point it out
explicitly it still don't get it.
This is my commandline:
gcc main.o rotoAction.o rotoCog.o -o RotoCube.exe -lstdc++
-L/usr/local/lib/ -lalleg
and the errors I get looks like this:
/usr/local/lib//liballeg.so: undefined reference to
`_poly_zbuf_atex_trans8'
/usr/local/lib//liballeg.so: undefined reference to
`_poly_scanline_atex_mask_lit32'
Which is kind of odd since before I added the -L flag it complained
about the .a file being missing. Now it's not being used.
How do ld decide where to look for libraries? Is there a way to teach it
systemwide not to search for ar archived, and in fact use the .so files?
And why on earth is the linker complaining about undefined references
now that it is actually looking at the right shared library file?
/Andreas
--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
More information about the freebsd-questions
mailing list