From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LAJUS-0005Pi-Fz for garchives@archives.gentoo.org; Wed, 10 Dec 2008 07:28:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8A878E033A; Wed, 10 Dec 2008 07:27:55 +0000 (UTC) Received: from md2.t-2.net (md2.t-2.net [84.255.209.81]) by pigeon.gentoo.org (Postfix) with ESMTP id 3C745E033A for ; Wed, 10 Dec 2008 07:27:55 +0000 (UTC) Received: from [192.168.0.11] (84-255-203-94.static.t-2.net [84.255.203.94]) by md2.t-2.net (MOS 3.10.2-GA) with ESMTP id CXS28486; Wed, 10 Dec 2008 08:27:53 +0100 (CET) Message-ID: <493F7BFC.4030503@avtomatika.com> Date: Wed, 10 Dec 2008 09:21:16 +0100 From: Branko Badrljica User-Agent: Thunderbird 2.0.0.18 (X11/20081123) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-amd64@lists.gentoo.org Reply-to: gentoo-amd64@lists.gentoo.org MIME-Version: 1.0 To: gentoo-amd64@lists.gentoo.org Subject: [gentoo-amd64] Curious thing- linking against .so libs... Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=10/150, host=md2.t-2.net X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A0B0201.493F6F7A.009D,ss=1,fgs=0, ip=192.168.0.11, so=2008-08-01 02:07:42, dmn=5.7.1/2008-09-02, mode=single engine X-Junkmail-IWF: false X-Archives-Salt: edf86753-b8b8-4672-8f18-20353d229cf9 X-Archives-Hash: faf877e9b591b285d931a293a47ab418 I was trying to install nVidia's CUDA SDK for toying with GPU as computing tool, but I soon found out that I can't compile anything. I always get error's like "can't find -lGL" etc from compiler. So I took a look where LIBPATHetc were set and everything seemed fine. After that, I tried with trivial "Hello world" test source. I tried to compile it, linking it with libGL.so. Compile failed with familiar "can't find...". Then I tried to link it to another libraries I found in /usr/lib64. It turns out that gcc wants to link to .a/.la files and completely seems to ignore .so. What gives ? I have standard Gentoo config on Phenom system with typical desktop setup. gcc is v-4.3.2. Test case program: #include void main ( int argc , char ** argv ) { printf("Argc is %d, arg zero is %s and arg one is %s\n" , argc, argv[0] , argv[1] ); }; Compile attempts that work fine: gcc -O2 -m32 -march=barcelona -pipe -o tt tt.c gcc -O2 -m32 -march=barcelona -pipe -L/usr/lib64 -lresolv -o tt tt.c ( resolv lib has .la and .so version ) One that fails: gcc -O2 -m32 -march=barcelona -pipe -L/usr/lib64 -lgdgeda -o tt tt.c (libgdgeda has just .so ) Any ideas ?