/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status报错原因

原因:C语言的头文件不够

错误代码:未导入#include<stdlib.h>报错

#include <stdio.h>
#define R 1
int main()
{
  float c,r,s;
  c = 2;
#if R
  r = 3.14*c*c;
  printf("area of round is: %f\n",r);
#else
  printf("byebye");
#endif
  return 0;
}
~       
posted @ 2022-08-22 11:09  nanfengnan  阅读(435)  评论(0编辑  收藏  举报