Arduino-Makefile:编译器无法编译用户库cpp文件

问题描述 投票:0回答:1

[我正在尝试将Raspberry Pi上的Arduino使用https://github.com/sudar/Arduino-Makefile和一些用户cpp库,但无法编译并在下面显示错误。

/ usr / share / arduino / hardware / tools / avr / bin / avr-gcc -mmcu = atmega2560-Wl,-gc-sections -Os -flto -fuse-linker-plugin -o build-mega-atmega2560 / toprint.elf build-mega-atmega2560 / toprint.ino.obuild-mega-atmega2560 / libcore.a -lc -lm/tmp/cc1J77Gh.ltrans0.ltrans.o:在函数main': <artificial>:(.text.startup+0x4be): undefined reference to Str2let :: ~~ Str2let()'collect2:错误:ld返回1退出状态make:*** [/home/pi/Desktop/demo1_may9/Arduino/toprint/Arduino-Makefile/Arduino.mk:1673:build-mega-atmega2560 / toprint.elf]错误1

我的配置文件为

ARDUINO_DIR   = /usr/share/arduino 
MONITOR_PORT  = /dev/ttyACM* 
USER_LIB_PATH = /home/pi/sketchbook/libraries

#BOARD_SUB   = mega2560 #replaced by below 
MCU = atmega2560

# Define Atmega2560 
BOARD_TAG    = mega 
BOARD_SUB    = atmega2560

AVRDUDE      = /usr/share/arduino/hardware/tools/avr

包括/home/pi/Desktop/demo1_may9/Arduino/toprint/Arduino-Makefile/Arduino.mk有人知道发生了什么吗?

相同的代码可以在Mac上运行,但不能在Pi上运行。

c++ c makefile arduino
1个回答
0
投票

通过使用case[2]中的post解决了。只是不要定义USER_LIB_PATH并将所有文件与.ino和Makefile放在同一位置。

© www.soinside.com 2019 - 2024. All rights reserved.