SOLVED: Working with Arduino in Eclipse

I've set myself an ambitious first project to try Arduinos out and found the official IDE to be a bit limited for what I'm trying to accomplish. I decided to give Eclipse a try as I've used it a bit before for Java development. I've got things mostly setup, but I'm having a bit of an issue. I have the Arduino Eclipse plugin installed and setup AVR Cross Target Static Library projects for Arduino Core and the Ethernet and SPI libraries. All are compiling fine and I get the static output files. When I go to link my sketch against the Ethernet library, though, I'm getting the following error.

avr-gcc -Os -Wl,--gc-sections  -L"C:\Users\dave\Documents\Arduino\Arduino_Ethernet/Release" -L"C:\Users\dave\Documents\Arduino\SPI\Release" -L"C:\Users\dave\Documents\Arduino\Ethernet\Release" -mmcu=atmega328p -o"SmartHome.elf"  ./src/SmartHome.o   -l"Arduino_Ethernet" -lSPI -lEthernet -lm
C:\Users\dave\Documents\Arduino\Ethernet\Release\libEthernet.a(w5100.o): In function `W5100Class::init()':
C:/arduino-1.0/libraries/Ethernet/utility/w5100.cpp:30: undefined reference to `SPIClass::begin()'
make: *** [SmartHome.elf] Error 1

I'm a bit at a loss what the issue is here, since SPI.begin() clearly exists and I'm including the SPI library in my link statement. I'm admittedly not super well versed in C/C++ development, so I may be over-looking something obvious though. Anyone have any suggestions?

In case anyone else runs across this issue. I solved it by changing the order of the libraries in my link statement. Apparently order actually matters and the lowest level libraries have to be listed last.

Thank you! I had the same issue using a static lib i'd built out of the Ethernet/SPI source in a project.

I also had the same problem with a couple of static libs I built for SPI and Adafruit’s CC3000 code.

Turns out that I had to put the libs (-lxxxx) AFTER the objets (.o) AND the least priority libs AFTER in order to work.

That is:
avr-g++ -o MyProject.elf -L/usr/lib/avr/lib/ <My .o compiled files> -lCC3000 -lSPI -lUTFT -lTimeUtils -lArduinoCoreMega2560

CC3000 depends on SPI. If you swap the order (-lSPI -lCC3000) you’d get the error mentioned in the original post.