[makefile]erreur lors de mingw32-make sous Window

ajp55 Messages postés 426 Date d'inscription   Statut Membre Dernière intervention   -  
fiddy Messages postés 11069 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,
J'ai écri un code C sous linux. ca marche et j'ai écri un makefile pour facilité la compilation et l'édition des liens.
Je suis revenu sur window, quand je tape la commande correspondant sur window pour l'utilisation make qui est mingw32-make, il ya plein d'erreur d'undefined index. voici le message affiché par l'invite de commande window
H:\automate>mingw32-make
gcc -c determiniser.c
gcc -o automate main.o automate.o determiniser.o
main.o: In function 'extraireChaine':
main.c:(.text+0x36): undefined reference to 'malloc'
main.c:(.text+0x86): undefined reference to 'stderr'
main.c:(.text+0xa9): undefined reference to 'fwrite'
main.c:(.text+0xb5): undefined reference to 'exit'
main.o: In function 'parcourir':
main.c:(.text+0x17b): undefined reference to 'printf'
main.c:(.text+0x1a2): undefined reference to 'sprintf'
main.o: In function 'calculReussit':
main.c:(.text+0x247): undefined reference to 'malloc'
main.c:(.text+0x271): undefined reference to 'sprintf'
main.c:(.text+0x27d): undefined reference to 'puts'
main.c:(.text+0x296): undefined reference to 'printf'
main.c:(.text+0x2d3): undefined reference to 'printf'
main.o: In function 'verifierMot':
main.c:(.text+0x31f): undefined reference to 'puts'
main.c:(.text+0x32c): undefined reference to 'printf'
main.c:(.text+0x343): undefined reference to '__isoc99_scanf'
main.c:(.text+0x36d): undefined reference to 'printf'
main.c:(.text+0x386): undefined reference to 'printf'
main.c:(.text+0x393): undefined reference to 'printf'
main.c:(.text+0x3aa): undefined reference to '__isoc99_scanf'
main.c:(.text+0x3c9): undefined reference to '__stack_chk_fail'
main.o: In function 'main':
main.c:(.text+0x3f2): undefined reference to 'perror'
main.c:(.text+0x3fe): undefined reference to 'exit'
main.c:(.text+0x459): undefined reference to 'est_deterministe'
main.c:(.text+0x469): undefined reference to 'puts'
main.c:(.text+0x475): undefined reference to 'puts'
main.c:(.text+0x48c): undefined reference to 'determiniser'
main.c:(.text+0x49d): undefined reference to 'puts'
main.c:(.text+0x4b6): undefined reference to 'puts'
automate.o: In function 'init_automate':
automate.c:(.text+0xf): undefined reference to 'malloc'

je comprend pas pourkoi sur ubuntu le programme automate marche, mais sur window il ya ces erreur.
Merci d'avance pour réponse. avant j'utilisai codeblock pour me programme C sur window, maintenant je faire avec makefile.


A voir également:

1 réponse

fiddy Messages postés 11069 Date d'inscription   Statut Contributeur Dernière intervention   1 846
 
Bonjour,

Au vu des messages d'erreur, il semblerait que le compilateur ne parvient pas à linker avec la libc.
Est-elle installée ? Comment as-tu installé gcc ?
0
ajp55 Messages postés 426 Date d'inscription   Statut Membre Dernière intervention   23
 
j'ai installé mingw-get-inst-20110802.exe et j'ai ajouté le chemin C:\MinGW a la variable d'environnement PATH. je pense que ma libc marche puisque quand je lance l'invite de commande et je tape gcc --help l'aide s'affiche.
0
fiddy Messages postés 11069 Date d'inscription   Statut Contributeur Dernière intervention   1 846
 
Fais une recherche du fichier libc.* pour s'en assurer.
0
ajp55 Messages postés 426 Date d'inscription   Statut Membre Dernière intervention   23
 
que je fasse la recherche du fichier dans le repertoir où j'ai installé le compilateur??
la recherche doit s'effectuer où?
0
fiddy Messages postés 11069 Date d'inscription   Statut Contributeur Dernière intervention   1 846
 
Effectue une recherche sur tout le système déjà pour savoir dans quel répertoire il est situé.
0