打印
[AVR单片机]

求助undefined reference to `main'

[复制链接]
5023|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
四叶草|  楼主 | 2007-5-5 16:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我想建一个有多个文件的工程,在makefile那里已经设置了TARGET =motor和SRC =lcd.c,而且motor.c里面还包括了“lcd.h”,但是在编译时出现了如下内容:
Linking: motor.elf
avr-gcc -mmcu=atmega8 -I. -gdwarf-2 -DF_CPU=100000UL  -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=lcd.o  -std=gnu99 -MD -MP -MF .dep/motor.elf.d lcd.o --output motor.elf -Wl,-M
ap=motor.map,--cref    -lm
e:/WinAVR/bin/../lib/gcc/avr/3.4.6/../../../../avr/lib/avr4/crtm8.o: In function `__vectors':
../../../../../avr-libc-1.4.4/crt1/gcrt1.S:51: undefined reference to `main'
make: *** [motor.elf] Error 1
究竟是什么问题呢?费解中……求助

相关下载

相关帖子

沙发
liweisdut| | 2014-5-16 10:55 | 只看该作者
解决了吗?我也遇到这个问题啊

使用特权

评论回复
板凳
liweisdut| | 2014-5-16 11:00 | 只看该作者
我找到原因了。我的是因为main.c是空的

使用特权

评论回复
地板
divinitus| | 2014-6-7 23:41 | 只看该作者
在Makefile的SRC字段中加入所有C文件名

使用特权

评论回复
5
divinitus| | 2014-6-7 23:42 | 只看该作者
liweisdut 发表于 2014-5-16 10:55
解决了吗?我也遇到这个问题啊

在Makefile的SRC字段中加入所有C文件名

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

71

主题

109

帖子

0

粉丝