我试图在Mac 10.12.6上的Eclipse Oxygen.1中编译helloworld.c
#include <stdio.h>
#include <stdlib.h>
int main(){
printf("Hello World!");
return 0;
}
它会引发这样的错误:
20:41:02 **** Incremental Build of configuration Debug for project HelloWorld ****
make all
Building target: HelloWorld
Invoking: Cross GCC Linker
gcc -o "HelloWorld" ./helloworld.o
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [HelloWorld] Error 1
20:41:03 Build Finished (took 938ms)
我很确定问题不是代码本身,而是什么?