永发信息网

arduino 编译出错了

答案:2  悬赏:40  手机版
解决时间 2021-03-21 11:35
  • 提问者网友:暮烟疏雨之际
  • 2021-03-20 22:53
代码没问题:
void setup()
{
Serial.begin(9600);
}

void loop()
{
char str[20] ={"hello world"};

Serial.println(str);
delay(10000);
Serial.println(str);
delay(5000);
}

错误:
Arduino: 1.6.3 (Windows 8.1), Board: "Arduino Uno"

Print.cpp.o: In function `loop':

D:\Arduino/Print.ino:10: undefined reference to `Print::println(char const*)'

D:\Arduino/Print.ino:12: undefined reference to `Print::println(char const*)'

C:\Users\bufan\AppData\Local\Temp\build8633840498311302340.tmp/core.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial[vtable for HardwareSerial]+0x6): undefined reference to `Print::write(unsigned char const*, unsigned int)'

collect2.exe: error: ld returned 1 exit status

Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

再次自行解决,arduino文件命名不能与库函数名相重。
最佳答案
  • 五星知识达人网友:执傲
  • 2021-03-20 23:09
你是uno的板子么?我编译了一下,确实没问题
全部回答
  • 1楼网友:鸽屿
  • 2021-03-21 00:21
1. 找不到max3421e.h 2. usb.h第131行语法错误 3. 152行byte没清空 4. 153行的byte是类型不是名字 5 byte本身没清空
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯