Makefile et inclusion de bibliothèque
Bonjour/Bonsoir à tous.
Lors de l'implementation du tri par insertion en C, j'ai un problème de Makefile. (en esperant ne pas me tromper de forum)
J'ai une bibliothèque libtabio.so fournie qui contient le code de deux fonctions me permettant de tester mon tri ; le header tabio.h lui est associé :
tabio.h :
Code:
1 2 3 4 5 6 7 8 9
|
// Interface du module tabio
#define LONGUEUR 10
typedef int Tableau[LONGUEUR];
void saisirTableau ( Tableau t );
void afficherTableau ( Tableau t ); |
Dans cet exercice il est également demandé de mettre le tabio.h dans un dossier "include" et libtabio.so dans un dossier "lib", comme c'est fait classiquement, histoire d'utiliser les options I et L et l de gcc.
Voici ce que donne simplement l'arborescence :
Code:
1 2 3 4 5 6 7 8 9 10
|
$ ls -R .
.:
include lib Makefile tri_insertion.c
./include:
tabio.h
./lib:
libtabio.so |
Voici mon Makefile :
Code:
1 2 3 4 5 6 7 8
|
FLAGS = -Wall -Wextra -O -Wwrite-strings -Wstrict-prototypes -Wuninitialized -Wunreachable-code
tri_insertion : tri_insertion.o lib/libtabio.so
gcc $(FLAGS) -Iinclude -Llib -llibtabio tri_insertion.o -o tri_insertion
tri_insertion.o : tri_insertion.c include/tabio.h
gcc $(FLAGS) -Iinclude -Llib -c tri_insertion.c |
La commande "make" me donne :
Code:
1 2 3 4 5 6
|
$ make
gcc -Wall -Wextra -O -Wwrite-strings -Wstrict-prototypes -Wuninitialized -Wunreachable-code -Iinclude -Llib -llibtabio tri_insertion.o -o tri_insertion
/usr/bin/ld: cannot find -llibtabio
collect2: ld a retourné 1 code d'état d'exécution
make: *** [tri_insertion] Erreur 1 |
:aie:
J'ai également essayé sans l'option -llibtabio mais rien à faire... Voilà la bibliothèque libtabio en question :
http://taroparigi.free.fr/tmp/libtabio.so
Si quelqu'un pouvait m'éclairer là-dessus, je lui en serais très reconnaissant. Merci d'avance!