在mac os x上使用arduino-builder进行编译时出错

时间:2017-03-26 01:09:29

标签: macos arduino

Arduino版本:1.8.2

Max OS X版本:10.12.3

arduino-builder -compile -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools -fqbn arduino:avr:uno -verbose SimpleTimer.ino

错误: fork/exec /bin/avr-g++: no such file or directory

2 个答案:

答案 0 :(得分:1)

在上述命令工作之前,我必须进行一些修复。

  • 在档案中 /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/platform.txt 更改此属性: compiler.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/

  • 在档案/Applications/Arduino.app//Contents/Java/hardware/platform.txt中 更改此属性: tools.ctags.path=/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11

信用: https://github.com/Sloeber/arduino-eclipse-plugin/issues/236

答案 1 :(得分:1)

Marcello的回答对我有用,但我会以包装脚本的形式提出一个更方便的解决方案来完成所有肮脏的工作:

#!/usr/bin/env bash
arduino-builder \
  -compile \
  -hardware /Applications/Arduino.app/Contents/Java/hardware \
  -tools /Applications/Arduino.app/Contents/Java/tools \
  -fqbn arduino:avr:uno \
  -libraries ../libraries/ \
  -prefs=compiler.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/ \
  -prefs=tools.ctags.path=/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11 \
  -verbose \
  SimpleTimer.ino