【问题标题】:avr-g++ compilation failed with Make Error 1avr-g++ 编译失败并出现 Make Error 1
【发布时间】:2015-06-05 21:02:36
【问题描述】:

我正在尝试在 Eclipse 中编译 Arduino 代码。以下是构建日志。

make all 
Building file: ../test.cpp
Starting C++ compile
"/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=163 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR     -I"/opt/arduino-1.6.3/hardware/arduino/avr/cores/arduino" -I"/opt/arduino-1.6.3/hardware/arduino/avr/variants/standard" -I/usr/lib/avr/include -MMD -MP -MF"test.cpp.d" -MT"test.cpp.d" -D__IN_ECLIPSE__=1 -x c++ "../test.cpp"  -o  "test.cpp.o"
as: unrecognized option '-mmcu=avr5'
make: *** [test.cpp.o] Error 1

怎么了? as: unrecognized option '-mmcu=avr5' 是什么意思?它无法识别-mmcu 选项?

【问题讨论】:

    标签: eclipse makefile arduino avr avr-gcc


    【解决方案1】:

    错误消息来自汇编程序as。 AVR 汇编器avr-as 接受-mmcu 选项。也许 Eclipse 选择了其他的as

    在 makefile 中使用 "/bin/avr-g++" 对我来说看起来很可疑。我认为您应该设置 Eclipse 以在正确的位置查找工具链,而无需在 makefile 命令中指定目录。

    【讨论】:

    • 是的。谢啦。将路径更改为/opt/arduino-1.6.3/hardware/tools/avr/bin/avr-g++
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多