Date: Wed, 2 Mar 2005 19:29:58 +0100 (CET) From: Andreas Davour <ante@Update.UU.SE> To: freebsd-questions@freebsd.org Subject: Where do the linker look for shared libraries? Message-ID: <Pine.LNX.4.62.0503021922580.8625@Psilocybe.Update.UU.SE>
next in thread | raw e-mail | index | archive | help
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?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.62.0503021922580.8625>