求助linux编译的一个问题

xiaoqiwen 2007-09-05 04:46:33
在linux下我用如下的命令去单步编译
gcc -c ADInclude.c
gcc -c test2.c
gcc -o test test2.o ADInclude.o
可以编译通过,但我用makefile文件去编译就会出错
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18): In function `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
collect2: ld returned 1 exit status
makefile文件的内容为
test2:test2.o ADInclude.o
gcc -o test2.o ADInclude.o

ADInclude.o:ADInclude.c
gcc -c ADInclude.c
test2.o:test2.c
gcc -c test2.c
...全文
102 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
meiZiNick 2008-05-01
  • 打赏
  • 举报
回复
我也想了解,谢谢LZ.
tb01412 2007-09-06
  • 打赏
  • 举报
回复
test2:test2.o ADInclude.o
gcc -o test test2.o ADInclude.o

1,075

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧