Bonjour à tous:
J'ai un projet C comportant les fichiers suivant:
box.c
box.h
field.h
field.c
target.c
target.h
parseXML.c (utilise libXML2)
parseXML.h (utilise libXML2)
try.c (pour tester les fonctions)
je lance les lignes de compilation suivantes:
gcc -Wall -O2 -fPIC -o field.o -c field.c
gcc -Wall -O2 -fPIC -o target.o -c target.c
gcc -Wall -O2 -fPIC -o box.o -c box.c
gcc -g -Wall parseXML.c -o parseXML.o `xml2-config --cflags` `xml2-config --libs`
tout ce pass très bien.
Puis je fais:
gcc try.c -o try.o `xml2-config --cflags` `xml2-config --libs`
et il me renvoie:
Toutes les fonctions qui lui sont inconnues sont déclarées et définies dans les fichiers précédement cités. Dans mon try.c , j'ai pourtant bien mis lesCitation:
/tmp/ccYUghz0.o: In function `main':
try.c:(.text+0xac): undefined reference to `countTarget'
try.c:(.text+0xca): undefined reference to `boxNew'
try.c:(.text+0x17a): undefined reference to `getPath'
try.c:(.text+0x18c): undefined reference to `getMethod'
try.c:(.text+0x1b7): undefined reference to `numberFields'
try.c:(.text+0x1d9): undefined reference to `numberFields'
try.c:(.text+0x265): undefined reference to `getFieldsNames'
try.c:(.text+0x285): undefined reference to `getFieldsValues'
try.c:(.text+0x2ad): undefined reference to `targetNew'
try.c:(.text+0x2d6): undefined reference to `fieldNew'
try.c:(.text+0x30a): undefined reference to `fieldFill'
try.c:(.text+0x315): undefined reference to `fieldFree'
try.c:(.text+0x35d): undefined reference to `targetFill'
try.c:(.text+0x368): undefined reference to `targetFree'
collect2: ld a retourné 1 code d'état d'exécution
#include "parseXML.h"
#include "box.h"
#include "field.h"
#include "target.h"
Help please!