我正在尝试将基于 Arduino IDE 的项目迁移到 Eclipse。该项目相当大(10 个 .pde,使用了大约 20 个库)。我按照 Arduino Playground - Eclipse 中的说明编译核心库并创建一个基础项目。当使用简单的 LED 闪烁程序进行测试时,所有内容都编译得很好。
为了使我的应用程序正常工作,我还需要一些更多的库(标准 Arduino 库,例如 SoftwareSerial、SPI 或 Wire)和自定义库。我像处理上面的核心库一样导入它们(我创建了另外两个项目)并编译它们。一切都很好。
将所有 .pde 导入 Eclipse 中的基础项目,将它们转换为类并稍微清理一下代码后,我无法解决的最后一个问题是多个变量定义,导致这样的错误:
./src/main.o: In function `__vector_37':
main.cpp:(.text.__vector_37+0x0): multiple definition of `__vector_37'
./src/MyClass.o:MyClass.cpp:(.text.__vector_37+0x0): first defined here
重点是,我不能使用 grep 在我的代码或包含的库中的任何位置查找任何 __vector_XX 变量。 Eclipse 关于在哪里寻找原因的提示也没有多大帮助。我应该怎么办?
I'm trying to migrate an Arduino IDE based project to Eclipse. The project is pretty big (10 .pde's, and about 20 libraries used). I followed the directions in Arduino playground - Eclipse to compile the core libraries and to create a base project. All compiles very well when testing it with a simple LED-blink program.
For my application to work I also needed some more libraries (standard Arduino libraries, for example, SoftwareSerial, SPI, or Wire) and custom ones. I imported them like I did with the core library above (I created two more projects) and compiled them. All worked nicely.
After importing all .pde's to the base project in Eclipse, converting them to classes and cleaning up the code a little bit the last problem I can't get rid of are multiple variable definitions, causing errors like this:
./src/main.o: In function `__vector_37':
main.cpp:(.text.__vector_37+0x0): multiple definition of `__vector_37'
./src/MyClass.o:MyClass.cpp:(.text.__vector_37+0x0): first defined here
The point is, I cannot find any __vector_XX variables anywhere in my code or included libraries with grep. Eclipse's hints regarding where to look for the cause also don't help much. What should I do?
发布评论
评论(1)
[摘自问题评论中@mmm的链接]:
修复类似问题。
[Taken from @mmm's link in the question comments]:
Fix for a similar issue.