Go Down

Topic: EthernetShield WebServer compile errors (Read 3174 times) previous topic - next topic

mjones73

I have the arduino uno r3 connected with the ethernet shield. When I try to compile the example WebServer project (or any project from the Ethernet examples) I'm getting SPI compile errors.

On this board is also an SD card interface present, and the SD example is compiling (and running) just fine. I just can't get to get the Ethernet examples to work. I have tried copying the library to the sketchbook folder, but no luck.

I'm using ARDUINO 1.0.1 - 2012.05.21 on ubuntu.

Is there something missing?

/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp: In member function 'void W5100Class::init()':
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp:28: error: 'delay' was not declared in this scope
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp:30: error: 'SPI' was not declared in this scope
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp: In static member function 'static uint8_t W5100Class::write(uint16_t, uint8_t)':
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp:133: error: 'SPI' was not declared in this scope
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp: In static member function 'static uint16_t W5100Class::write(uint16_t, const uint8_t*, uint16_t)':
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp:146: error: 'SPI' was not declared in this scope
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp: In static member function 'static uint8_t W5100Class::read(uint16_t)':
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp:159: error: 'SPI' was not declared in this scope
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp: In static member function 'static uint16_t W5100Class::read(uint16_t, uint8_t*, uint16_t)':
/home/marek/sketchbook/libraries/Ethernet/utility/w5100.cpp:172: error: 'SPI' was not declared in this scope

SurferTim

Did you include the SPI.h file?
Code: [Select]
#include <SPI.h>
#include <Ethernet.h>
// rest of your code


mjones73

Yes, the spi.h file is included. I haven't touched the example code.

SurferTim

#3
May 31, 2012, 12:44 pm Last Edit: May 31, 2012, 01:28 pm by SurferTim Reason: 1
I'm using Ubuntu 11.10, and I do not get those errors. Did you download and install the Arduino IDE from the Ubuntu repository first? It is v0022, but has all the avr-gcc and avr-libc updates.

edit: Install IDE v0022 from the Ubuntu Software Center in your launcher.

mjones73

That fixed the problem. Thank you.  :D

Time for real fun!

Go Up