Errors compiling sketch with Ethernet.h on updated Debian Linux

Hello,

I cannot compiled any sketch including Ethernet.h.
I tried this, some hours without a solution.
All others examples sketch compile fine.

Have you an idea to fix this ?

Regards.

The sketch :

#include <SPI.h>
#include <Ethernet.h>

// the media access control (ethernet hardware) address for the shield:
byte mac = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
//the IP address for the shield:
byte ip = { 10, 0, 0, 177 };

void setup()
{
Ethernet.begin(mac, ip);
}

void loop () {}

The errors :

/usr/share/arduino/libraries/Ethernet/Ethernet.cpp: In member function ‘void EthernetClass::begin(uint8_t*, IPAddress, IPAddress, IPAddress, IPAddress)’:
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:64:39: error: no matching function for call to ‘W5100Class::setIPAddress(IPAddress::&)’
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:64:39: note: candidate is:
In file included from /usr/share/arduino/libraries/Ethernet/Ethernet.cpp:1:0:
/usr/share/arduino/libraries/Ethernet/utility/w5100.h:392:6: note: void W5100Class::setIPAddress(uint8_t*)
/usr/share/arduino/libraries/Ethernet/utility/w5100.h:392:6: note: no known conversion for argument 1 from ‘IPAddress::’ to ‘uint8_t* {aka unsigned char*}’
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:65:38: error: no matching function for call to ‘W5100Class::setGatewayIp(IPAddress::&)’
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:65:38: note: candidate is:
In file included from /usr/share/arduino/libraries/Ethernet/Ethernet.cpp:1:0:
/usr/share/arduino/libraries/Ethernet/utility/w5100.h:368:6: note: void W5100Class::setGatewayIp(uint8_t*)
/usr/share/arduino/libraries/Ethernet/utility/w5100.h:368:6: note: no known conversion for argument 1 from ‘IPAddress::’ to ‘uint8_t* {aka unsigned char*}’
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:66:38: error: no matching function for call to ‘W5100Class::setSubnetMask(IPAddress::&)’
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:66:38: note: candidate is:
In file included from /usr/share/arduino/libraries/Ethernet/Ethernet.cpp:1:0:
/usr/share/arduino/libraries/Ethernet/utility/w5100.h:376:6: note: void W5100Class::setSubnetMask(uint8_t*)
/usr/share/arduino/libraries/Ethernet/utility/w5100.h:376:6: note: no known conversion for argument 1 from ‘IPAddress::’ to ‘uint8_t* {aka unsigned char*}’

Arduino program release 1.0.1 from Debian Testing on a Debian Squeeze base. This distribution works very fine and is stable for me.
.
$ avr-gcc --version
avr-gcc (GCC) 4.7.0

Have you tried downloading IDE v1.0.1 from the Arduino site? How does it do?

Yes ! Thank you very much, this is fixing the problem.

I installed the official arduino in an owned directory. I had give the rights to launch the script arduino and all rocks !

But to understand and to try to fix the Debian package (a few mixed release distribution), I investigate a little.

I see with official package :

Experimental: JNI_OnLoad called.

Stable Library

Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7

The unstable librxtx-java package Debian that I used, is the 2.2pre2-11. The stable is 2.2pre2-2.

Do you think that is the origin of the issue ? Another track is a possible problem of rights in the Debian package ? Where are put the .o files or other temporary files ?

I will guess it is something in the Debian version of Ethernet.cpp.

/usr/share/arduino/libraries/Ethernet/Ethernet.cpp: In member function ‘void EthernetClass::begin(uint8_t*, IPAddress, IPAddress, IPAddress, IPAddress)’:
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:64:39: error: no matching function for call to ‘W5100Class::setIPAddress(IPAddress::&)’
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:64:39: note: candidate is:
In file included from /usr/share/arduino/libraries/Ethernet/Ethernet.cpp:1:0:
/usr/share/arduino/libraries/Ethernet/utility/w5100.h:392:6: note: void W5100Class::setIPAddress(uint8_t*)
/usr/share/arduino/libraries/Ethernet/utility/w5100.h:392:6: note: no known conversion for argument 1 from ‘IPAddress::’ to ‘uint8_t* {aka unsigned char*}’

I’m running Arduino 1.0.1 on Ubuntu 11.10 and have what looks like the same problem …
/usr/share/arduino/libraries/Ethernet/Ethernet.cpp:64:39: error: no matching function for call to
W5100Class::setIPAddress(IPAddress::&)

So… I had a careful look at the code and the lines that are wrong are about #64, where the IPAddress union _address is used when the method raw_address() is needed, as shown below …

  W5100.setIPAddress(local_ip.raw_address());
  W5100.setGatewayIp(gateway.raw_address());
  W5100.setSubnetMask(subnet.raw_address());

The IPAddress class seems to be capable of being treated as either 4 bytes, or a class instance in most cases, but not like this.

Insure you are running v1.0.1. I downloaded it from the Arduino website and unpacked it in a local directory. The I run the arduino shell script in that directory. It doesn't use the IDE in /usr/share/arduino/.

I CAN NOT COMPILE ANY PROGRAM AS WELL WITH ARDUINO SHIELD, USING WINDOWS 7 AND ETHERNET library LAST VERSION,

What errors are you getting?