在Eclipse下使用arduino Ethernet.h
我想使用eclipse进行Arduino开发,我有一些问题 我使用Eclipse+eclipseavr插件+WinAVR。我设法将Arduino核心库编译成一个静态库 现在我想使用我的以太网屏蔽,但我找不到一种方法在Eclipse中使用以太网库在Eclipse下使用arduino Ethernet.h,eclipse,arduino,ethernet,winavr,Eclipse,Arduino,Ethernet,Winavr,我想使用eclipse进行Arduino开发,我有一些问题 我使用Eclipse+eclipseavr插件+WinAVR。我设法将Arduino核心库编译成一个静态库 现在我想使用我的以太网屏蔽,但我找不到一种方法在Eclipse中使用以太网库 将文件夹从arduino-022/libraries/Ethernet和arduino-022/libraries/SPI复制到我的项目文件夹中,然后我对include进行了一些更改,以便工作。结果是关于DDRB和PORTB的一些错误 将Ethernet
arduino-022/libraries/Ethernet
和arduino-022/libraries/SPI
复制到我的项目文件夹中,然后我对include进行了一些更改,以便工作。结果是关于DDRB
和PORTB
的一些错误我不知道还能做什么。有人试过这样的东西吗?我花了一整天的时间试图弄明白这一点,结果证明其实没那么难。损失的时间是由于某些设置对make文件是“不可见”的。此外,生成的eclipse makefiles对于任何人来说都非常神秘,不必深入阅读手册。如果您想查看解决方案本身的。步骤: 简短版本: 制定Arduino核心库的静态库项目并进行构建 为SPI、w5100和以太网制作单独的静态库项目 项目建设必须建立一些联系。首先,我将include目录设置为正确指向,下面将对其进行描述。其次,我将项目引用设置为正确的,这样就可以使用所有正确的依赖构建来构建应用程序
- SPI->包括arduino内核
- w5100->包括arduino堆芯和SPI
- 以太网->包括arduino核心SPI和w5100
- 应用程序本身->只包括w5100和以太网(假设它只是以太网库)
- 应用程序本身->将项目的所有路径添加到库路径和相应的库(不带lib前缀)
(旁注:Arduino IDE应该被完全禁止,并迁移到Eclipse或一些真正的IDE)感谢您的支持。我会检查一下,看看会发生什么。我也有同样的问题,这对我的项目至关重要。希望它能起作用 main.cpp:(.text+0x8): undefined reference to `Server::Server(unsigned int)' ./main.o: In function `loop': main.cpp:(.text+0x36): undefined reference to `Server::available()' main.cpp:(.text+0x3c): undefined reference to `Client::operator bool()' main.cpp:(.text+0x56): undefined reference to `Client::available()' main.cpp:(.text+0x64): undefined reference to `Client::read()' main.cpp:(.text+0xf6): undefined reference to `Client::connected()' main.cpp:(.text+0x110): undefined reference to `Client::stop()' ./main.o: In function `setup': main.cpp:(.text+0x138): undefined reference to `Ethernet' main.cpp:(.text+0x13a): undefined reference to `Ethernet' main.cpp:(.text+0x144): undefined reference to `EthernetClass::begin(unsigned char*, unsigned char*)' main.cpp:(.text+0x14c): undefined reference to `Server::begin()'