From owner-freebsd-questions@FreeBSD.ORG Wed Mar 2 18:30:05 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FD2216A4CE for ; Wed, 2 Mar 2005 18:30:05 +0000 (GMT) Received: from pernis.its.uu.se (pernis.its.UU.SE [130.238.4.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id F376643D53 for ; Wed, 2 Mar 2005 18:30:03 +0000 (GMT) (envelope-from ante@Update.UU.SE) Received: by pernis.its.uu.se (Postfix, from userid 205) id DD78920D; Wed, 2 Mar 2005 19:30:02 +0100 (MEZ) Received: from pernis.its.uu.se(127.0.0.1) by pernis.its.uu.se via virus-scan id s307; Wed, 2 Mar 05 19:29:59 +0100 Received: from Psilocybe.Update.UU.SE (Psilocybe.Update.UU.SE [130.238.19.25]) by pernis.its.uu.se (Postfix) with ESMTP id 2089020D for ; Wed, 2 Mar 2005 19:29:59 +0100 (MEZ) Received: by Psilocybe.Update.UU.SE (Postfix, from userid 30086) id 095C938012; Wed, 2 Mar 2005 19:29:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by Psilocybe.Update.UU.SE (Postfix) with ESMTP id EBA705C002 for ; Wed, 2 Mar 2005 19:29:58 +0100 (CET) Date: Wed, 2 Mar 2005 19:29:58 +0100 (CET) From: Andreas Davour To: freebsd-questions@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Where do the linker look for shared libraries? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2005 18:30:05 -0000 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?