shared library

Top Page

Reply to this message
Author: Patrick Dupre
Date:  
To: Guilde
Subject: shared library
Bonjour,

J'ai un petit souci avec les libraries partagees:
Je fais une "shared library" a l'aide de:
gcc -c -fPIC cwerf.c -o cwerf.o
gcc -shared -Wl,-soname,cwerf.so -o libcwerf.so.1.0 cwerf.o

puis j'installe libcwerf.so.1.0 dans ~/mylib ou j'ai un lien:
libcwerf.so -> libcwerf.so.1.0

Esuite, je fais un lien avec mon exectutable:
gcc test.o -L~/mylib -lm -lcwerf -o test

Et ldd test me donne:
cwerf.so => not found

La je ne comprends pas pourquoi la librairie n'est pas trouvee !
Bien evidemment j'ai une erreur au chargement :
./test: error while loading shared libraries: cwerf.so: cannot open shared
object file: No such file or directory

De plus j'ai positionne:
LD_LIBRARY_PATH=~/mylib

Qu'est ce qui ne va pas ?


-- 
---
==========================================================================
  Patrick DUPRÉ                      |   |
  Department of Chemistry            |   |    Phone: (44)-(0)-1904-434384
  The University of York             |   |    Fax:   (44)-(0)-1904-432516
  Heslington                         |   |
  York YO10 5DD  United Kingdom      |   |    email: pd520@???
==========================================================================