本文介绍了意外的EOF在Eclipse OS X上的Arduino连接项目时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图链接的Arduino和Eclipse的,我觉得我很近。

I have been trying to link Arduino and Eclipse, and I feel like I'm close.

我应该从哪里开始找这个?

Where should I start looking for this?

类似的错误已(根据谷歌搜索)造成额外的/不完整的报价块。我已经通过我的AVR连接器设置挖找报价,但没有多少运气。

Similar errors have been caused by extra/incomplete quote blocks (according to google searches). I have already dug through my AVR linker settings looking for quotes, but haven't had much luck.

我是找对了地方?

我应该检查哪些文件?

我已经看过我写我自己(在这种情况下,基本的Arduino眨眼程序)的文件中。

I have already looked in the file I have written myself (in this case, the basic Arduino blink program).

**** Build of configuration Release for project C64_Arduino1 ****

make all 
Building target: C64_Arduino1.elf
Invoking: AVR C++ Linker
avr-gcc --cref -s -Os -o"C64_Arduino1.elf"  ./C64_Arduino1.o ./CDC.o ./HID.o 
./HardwareSerial.o ./Print.o ./Stream.o ./Tone.o ./USBCore.o ./WInterrupts.o ./WMath.o ./WString.o ./malloc.o ./wiring.o ./wiring_analog.o ./wiring_digital.o ./wiring_pulse.o 
./wiring_shift.o   -l"Arduino_Mega_2560_or_Mega_ADK" -lm -L/Users/Chet/Desktop/Chet's Shit/Side Projects/Programming/C64_Arduino1/Release -L"/Users/Chet/Desktop/Chet's Shit/Side 
Projects/Programming/C64_Arduino1" -mmcu=atmega2560
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [C64_Arduino1.elf] Error 2

**** Build Finished ****

编辑:

我都注释掉了我所有的code(包括#包括的),除了主(里面是空的),我仍然得到错误。我已成立了我的IDE作为指定的这里,也是在这里。仍然一无所获。

I have commented out all of my code (including #include's) except the main (which is empty) and I still get the error. I have set up my IDE as specified Here and also Here. Still nothing.

推荐答案

看实际的错误消息:

/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file

我可以看到这个问题是最有可能是由于某种Makefile的语法错误。

I can see that the problem is most likely due to some kind of Makefile syntax error.

当你写一个生成规则像这样的:

When you write a make rule such like:

foo:
    touch foo

做什么呢,它首先checkes是否名为已经存在,如果没有,那么它运行的命令 / bin / sh的-c'触摸富'。那么,我们说行触摸富应具有有效的shell脚本语法。

What make does, it first checkes whether file called foo exists already, if not, then it runs command /bin/sh -c 'touch foo'. So the line where we said touch foo should have valid shell script syntax.

望着那你最后运行命令:

Looking at the command that you ended up running:

avr-gcc --cref -s -Os -o"C64_Arduino1.elf"  ./C64_Arduino1.o ./CDC.o ./HID.o 
./HardwareSerial.o ./Print.o ./Stream.o ./Tone.o ./USBCore.o ./WInterrupts.o ./WMath.o ./WString.o ./malloc.o ./wiring.o ./wiring_analog.o ./wiring_digital.o ./wiring_pulse.o 
./wiring_shift.o   -l"Arduino_Mega_2560_or_Mega_ADK" -lm -L/Users/Chet/Desktop/Chet's Shit/Side Projects/Programming/C64_Arduino1/Release -L"/Users/Chet/Desktop/Chet's Shit/Side 
Projects/Programming/C64_Arduino1" -mmcu=atmega2560

我可以看到的问题是,在某些目录路径的 字符。您应该逃避它(如/用户/切特/桌面/切特\\的妈),或者作为一个快速解决方法符号链接或移动目录。

I can see that the issue is with the ' character in some of the directory paths. You should either escape it (as in "/Users/Chet/Desktop/Chet\'s Shit") or, as a quick work-around symlink or move the directory.

作为一般的方法技巧,你应该先检查是否所有在CLI的工作,然后转移到教学Eclipse的什么命令它应该运行。

As a general methodology tip, you should first check whether everything works in CLI, and then move on to teaching Eclipse what commands it should run.

另外,我会考虑使用被称为工具的 的而不是作,它可能只是最低配置工作。我有一些经验,只是一个Makefile文件替换Arduino的IDE,但是当你需要使用不同的主板也许还有好几个在同一时间连接它得到毛。给出的伊诺的一个尝试,它看起来很有希望。

Also, I would consider using the tool called ino instead of make, it might just work with minimum configuration. I have had some experience replacing Arduino IDE with just a Makefile, but it gets hairy when you need to use different boards and perhaps several connected at the same time. Give ino a try, it looks quite promising.

这篇关于意外的EOF在Eclipse OS X上的Arduino连接项目时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 08:38