Gentoo Archives: gentoo-amd64

From: Branko Badrljica <brankob@××××××××××.com>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Curious thing- linking against .so libs...
Date: Wed, 10 Dec 2008 07:28:12
Message-Id: 493F7BFC.4030503@avtomatika.com
1 I was trying to install nVidia's CUDA SDK for toying with GPU as
2 computing tool, but I soon found out that I can't compile anything.
3
4 I always get error's like "can't find -lGL" etc from compiler. So I took
5 a look where LIBPATHetc were set and everything seemed fine.
6
7 After that, I tried with trivial "Hello world" test source. I tried to
8 compile it, linking it with libGL.so. Compile failed with familiar
9 "can't find...".
10
11 Then I tried to link it to another libraries I found in /usr/lib64. It
12 turns out that gcc wants to link to .a/.la files and completely seems to
13 ignore .so.
14
15 What gives ?
16
17 I have standard Gentoo config on Phenom system with typical desktop
18 setup. gcc is v-4.3.2.
19
20 Test case program:
21
22 #include <stdio.h>
23
24 void main ( int argc , char ** argv ) {
25 printf("Argc is %d, arg zero is %s and arg one is %s\n" , argc,
26 argv[0] , argv[1] );
27 };
28
29
30 Compile attempts that work fine:
31
32 gcc -O2 -m32 -march=barcelona -pipe -o tt tt.c
33
34
35 gcc -O2 -m32 -march=barcelona -pipe -L/usr/lib64 -lresolv -o tt tt.c (
36 resolv lib has .la and .so version )
37
38 One that fails:
39
40 gcc -O2 -m32 -march=barcelona -pipe -L/usr/lib64 -lgdgeda -o tt tt.c
41 (libgdgeda has just .so )
42
43
44 Any ideas ?

Replies

Subject Author
[gentoo-amd64] Re: Curious thing- linking against .so libs... Nikos Chantziaras <realnc@×××××.de>