bonjour,
j'ai un probleme pour compiler mon programme sur ubuntu alors que ça marchait sur mac.
le programme utilise math.h, j'ai donc inclu math.h et j'ai compilé le programme (avec un makefile)
avec l'option -lm a la fin, mais rien a faire ça compile pas :/
j'ai des erreurs du genre:
undefined reference to `tanh'
undefined reference to `log'
undefined reference to `sinh'
undefined reference to `sin'
est ce que quelqu'un sait d'où vient le problème ?
je vous met le makefile au cas ou:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
projet: main.o Question_1.o Question_2.o Question_3.o
gcc -o projet main.o Question_1.o Question_2.o Question_3.o
Question_1.o: Question_1.c Question_1.h
gcc -c Question_1.c -o Question_1.o -lm
Question_2.o: Question_2.c Question_2.h
gcc -c Question_2.c -o Question_2.o -lm
Question_3.o: Question_3.c Question_3.h
gcc -c Question_3.c -o Question_3.o -lm
main.o: main.c Question_1.h Question_2.h Question_3.h
gcc -c main.c -o main.o -lm
clean :
rm *.o |
Partager