C++ 在eclipse中编译arduino时链接器分段错误

C++ 在eclipse中编译arduino时链接器分段错误,c++,eclipse,arduino,C++,Eclipse,Arduino,我正在尝试在Eclipse中构建arduino代码。我能够建造ArduinoCore。但是在构建应用程序时,我在链接过程中遇到了一个分段错误 Building target: TestAVR.elf Invoking: AVR C++ Linker avr-gcc –cref -s -Os -o”TestAVR.elf” ./src/main.o -lArduinoCore -lm -Wl,-Map,TestAVR.map,–cref -mrelax -Wl,–gc-sections -L/ho

我正在尝试在Eclipse中构建arduino代码。我能够建造ArduinoCore。但是在构建应用程序时,我在链接过程中遇到了一个分段错误

Building target: TestAVR.elf
Invoking: AVR C++ Linker
avr-gcc –cref -s -Os -o”TestAVR.elf” ./src/main.o -lArduinoCore -lm -Wl,-Map,TestAVR.map,–cref -mrelax -Wl,–gc-sections -L/home/harsh/workspace/avr/ArduinoCore/Release -mmcu=atmega328p
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
make: *** [TestAVR.elf] Error 1
Binutils is the latest version

所有的工具似乎都是最新的。库是否未正确构建,或者是链接器的问题?

已将链接器命令从

avr-gcc –cref -s -Os -o”TestAVR.elf” ./src/main.o -lArduinoCore -lm -Wl,-Map,TestAVR.map,–cref -mrelax -Wl,–gc-sections -L/workspace/avr/ArduinoCore/Release -mmcu=atmega328p


如果你的链接器出现故障,它工作正常。

。这是链接器中的一个bug。一个正确的程序不会出错。我怎样才能解决这个问题?提交一份错误报告,并希望他们能修复它。在那之前,要么修改代码,要么使用其他工具。很抱歉,我遵循了一个教程,其中提到链接器命令为avr gcc-cref-s-Os-o“TestAVR.elf”。/src/main.o-lArduinoCore-lm-Wl,-Map,TestAVR.Map,-cref-mrelax-Wl,–gc部分-L/home/harsh/workspace/avr/ArduinoCore/Release-mmcu=atmega328p我把它改成了avr-g++,它可以很好地工作,我错过了。链接器仍然不应该使用segfault,但我想它不使用错误的语言是可以原谅的。
avr-g++