在CentOS中编译c源文件,遇到(.text+0x20): undefined reference to `main'

这是我的bat文件

gcc -c ./shared/108/io.c -o io-1.o 2>>error-1.txt
gcc -I ./shared/108 -c ./000/082/975/CWE190_Integer_Overflow__int_connect_socket_add_02.c -o io-2.o 2>>error-2.txt
gcc -I ./shared/108  -g io-2.o io-1.o   2>>error-3.txt

第一步和第二步都没有出错,第三步就报错:

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

也求教了很多人,有人问我是不是根本就没有写main()函数,这也就尴尬了,我真的写了,怎么就找不到。

c源文件,部分代码如下:

/* Below is the main(). It is only used when building this testcase on

   its own for testing or for building a binary to use in testing binary

   analysis tools. It is not used when compiling all the testcases as one

   application, which is how source code analysis tools are tested. */

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值