[其它] 为开发板Arduino/Genuino Mega orMega 2560编译时出错

[复制链接]
 楼主| JJyongqi 发表于 2019-4-18 14:47 | 显示全部楼层 |阅读模式
为开发板Arduino/Genuino Mega orMega 2560编译时出错
求解决
Arduino:1.8.8 (Windows 10), 开发板:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

libraries\BEEP\BEEP.cpp.o (symbol from plugin): In function `_BEEP::_BEEP()':

(.text+0x0): multiple definition of `_BEEP::_BEEP()'

sketch\BEEP.cpp.o (symbol from plugin):(.text+0x0): first defined here

d:/arduino/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions

libraries\BEEP\BEEP.cpp.o (symbol from plugin): In function `_BEEP::_BEEP()':

(.text+0x0): multiple definition of `_BEEP::_BEEP()'

sketch\BEEP.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\BEEP\BEEP.cpp.o (symbol from plugin): In function `_BEEP::_BEEP()':

(.text+0x0): multiple definition of `_BEEP::~_BEEP()'

sketch\BEEP.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\BEEP\BEEP.cpp.o (symbol from plugin): In function `_BEEP::_BEEP()':

(.text+0x0): multiple definition of `_BEEP::~_BEEP()'

sketch\BEEP.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\BEEP\BEEP.cpp.o (symbol from plugin): In function `_BEEP::_BEEP()':

(.text+0x0): multiple definition of `_BEEP::TurnOn()'

sketch\BEEP.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\BEEP\BEEP.cpp.o (symbol from plugin): In function `_BEEP::_BEEP()':

(.text+0x0): multiple definition of `_BEEP::TurnOff()'

sketch\BEEP.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\BEEP\BEEP.cpp.o (symbol from plugin): In function `_BEEP::_BEEP()':

(.text+0x0): multiple definition of `_BEEP::Initialization()'

sketch\BEEP.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\BEEP\BEEP.cpp.o (symbol from plugin): In function `_BEEP::_BEEP()':

(.text+0x0): multiple definition of `BEEP'

sketch\BEEP.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
为开发板 Arduino/Genuino Mega or Mega 2560 编译时出错。

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。

dirtwillfly 发表于 2019-4-22 22:53 | 显示全部楼层
从错误信息看是出现了多重定义,方便的话建议楼主上传下代码
dirtwillfly 发表于 2019-4-22 22:59 | 显示全部楼层
elongshi 发表于 2023-10-26 17:09 | 显示全部楼层
TurnOn(),_BEEP()这些函数你没写吧,直接引用提示函数未定义。如果是直接引用已有库函数,defined引用部分没搞好。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

2

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部