在Mac Mojave上运行简单的hello世界时出现链接器错误

时间:2019-02-27 18:30:02

标签: c macos

我收到以下链接器错误:

来源(hello_world.c):

#include <stdio.h>

int main(){
   printf("hello world\n");
   return 0;
}

编译:

$ gcc hello_world.c 
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)
$

0 个答案:

没有答案