undefined reference to `_hello'
Un bonjour printannier,
L'appel de hello() dans main cause une erreur.
Tous les fichiers sont dans le même dossier.
Si je commente //hello();, ça compile.
Vista 64 adm 64
Citation:
$ gcc -mno-cygwin -Wall -omain.exe main.c
/cygdrive/c/Temp/ccYHqrxX.o:main.c:(.text+0x37): undefined reference to `_hello'
Merci
JPD
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| -----------
/* hello.c */
#include "hello.h"
void hello(void)
{
puts ("Hello world2!");
}
-----------
/* main.c */
#include "hello.h"
#include <stdio.h>
int main (void)
{
puts ("Hello world1!");
hello();
printf("Hello World3!");
return 0;
}
******************** |