搜索
bottom↓
回复: 5

求助:AVR Studio出问题:make: *** [receive.elf] Error 1

[复制链接]

出0入0汤圆

发表于 2013-1-21 23:38:05 | 显示全部楼层 |阅读模式
今天用mega8 写 nrf24l01程序,出现error,不知道什么原因,网上也找不到合适的,麻烦各位大神帮忙看看~

rm -rf main.o ad.o led.o 2401.o  receive.elf dep/* receive.hex receive.eep receive.lss receive.map
Build succeeded with 0 Warnings...
In file included from ../main.c:10:
../2401.h: In function 'nRF24L01_TxPacket':
../2401.h:199: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
../2401.h:207:2: warning: "/*" within comment
../2401.h: In function 'init_NRF24L01':
../2401.h:214: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
../2401.h:215: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
../main.c: In function 'main':
../main.c:21: warning: implicit declaration of function 'nrf2401_init'
avr-gcc  -mmcu=atmega8 -Wall -gdwarf-2 -std=gnu99           -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT ad.o -MF dep/ad.o.d  -c  ../ad.c
In file included from ../ad.c:3:
../2401.h: In function 'nRF24L01_TxPacket':
../2401.h:199: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
../2401.h:207:2: warning: "/*" within comment
../2401.h: In function 'init_NRF24L01':
../2401.h:214: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
../2401.h:215: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
In file included from ../2401.c:4:
../2401.h: In function 'nRF24L01_TxPacket':
../2401.h:199: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
../2401.h:207:2: warning: "/*" within comment
../2401.h: In function 'init_NRF24L01':
../2401.h:214: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
../2401.h:215: warning: pointer targets in passing argument 2 of 'SPI_Write_Buf' differ in signedness
avr-gcc -mmcu=atmega8 -Wl,-Map=receive.map main.o ad.o led.o 2401.o     -o receive.elf
ad.o: In function `Delay':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:101: multiple definition of `Delay'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:101: first defined here
ad.o: In function `SPI_RW':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:108: multiple definition of `SPI_RW'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:108: first defined here
ad.o: In function `SPI_RW_Reg':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:147: multiple definition of `SPI_RW_Reg'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:147: first defined here
ad.o: In function `SPI_Write_Buf':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:180: multiple definition of `SPI_Write_Buf'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:180: first defined here
ad.o: In function `nRF24L01_TxPacket':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:197: multiple definition of `nRF24L01_TxPacket'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:197: first defined here
ad.o:(.data+0x1): multiple definition of `TX_ADDRESS'
main.o:(.data+0x1): first defined here
ad.o: In function `init_NRF24L01':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:211: multiple definition of `init_NRF24L01'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:211: first defined here
ad.o:(.data+0x6): multiple definition of `RX_ADDRESS'
main.o:(.data+0x6): first defined here
ad.o: In function `UART_INIT':
D:\T-CTRL\T-ctrl-pro\default/../uartx.h:12: multiple definition of `UART_INIT'
main.o:D:\T-CTRL\T-ctrl-pro\default/../uartx.h:12: first defined here
ad.o: In function `UART_Putchar':
D:\T-CTRL\T-ctrl-pro\default/../uartx.h:23: multiple definition of `UART_Putchar'
main.o:D:\T-CTRL\T-ctrl-pro\default/../uartx.h:23: first defined here
ad.o: In function `UART_Putstring':
D:\T-CTRL\T-ctrl-pro\default/../uartx.h:29: multiple definition of `UART_Putstring'
main.o:D:\T-CTRL\T-ctrl-pro\default/../uartx.h:29: first defined here
ad.o:(.data+0x0): multiple definition of `TxBuf'
main.o:(.data+0x0): first defined here
2401.o: In function `Delay':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:101: multiple definition of `Delay'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:101: first defined here
2401.o: In function `SPI_RW':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:108: multiple definition of `SPI_RW'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:108: first defined here
2401.o: In function `SPI_RW_Reg':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:147: multiple definition of `SPI_RW_Reg'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:147: first defined here
2401.o: In function `SPI_Write_Buf':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:180: multiple definition of `SPI_Write_Buf'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:180: first defined here
2401.o: In function `nRF24L01_TxPacket':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:197: multiple definition of `nRF24L01_TxPacket'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:197: first defined here
2401.o:(.data+0x1): multiple definition of `TX_ADDRESS'
main.o:(.data+0x1): first defined here
2401.o: In function `init_NRF24L01':
D:\T-CTRL\T-ctrl-pro\default/../2401.h:211: multiple definition of `init_NRF24L01'
main.o:D:\T-CTRL\T-ctrl-pro\default/../2401.h:211: first defined here
2401.o:(.data+0x6): multiple definition of `RX_ADDRESS'
main.o:(.data+0x6): first defined here
2401.o:(.data+0x0): multiple definition of `TxBuf'
main.o:(.data+0x0): first defined here
make: *** [receive.elf] Error 1
Build failed with 1 errors and 58 warnings...

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

发表于 2013-1-21 23:53:39 | 显示全部楼层
重定义了?

出0入0汤圆

 楼主| 发表于 2013-1-21 23:58:48 | 显示全部楼层
faduo2012 发表于 2013-1-21 23:53
重定义了?

是的,我把所有的文件都和到一个主函数里就没事了。但是我的每个.h 都加了#ifndef......#endif,很奇怪呀......

出0入0汤圆

发表于 2013-1-22 00:01:23 | 显示全部楼层
gzc581 发表于 2013-1-21 23:58
是的,我把所有的文件都和到一个主函数里就没事了。但是我的每个.h 都加了#ifndef......#endif,很奇怪呀. ...

你好,能上传代码来看看不

出0入0汤圆

发表于 2013-1-22 02:12:39 | 显示全部楼层
貌似是Linking的时候标号有重复的。

出0入0汤圆

 楼主| 发表于 2013-1-24 10:18:53 | 显示全部楼层
faduo2012 发表于 2013-1-22 00:01
你好,能上传代码来看看不

已解决,谢谢你~~是因为我在.h里面定义了个数组,后来放到.c里再在.h里声明就好了
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-24 07:18

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表