Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Can't compile basic Ethernet sketch #55

Closed
zarate opened this issue Dec 21, 2012 · 8 comments
Closed

Can't compile basic Ethernet sketch #55

zarate opened this issue Dec 21, 2012 · 8 comments

Comments

@zarate
Copy link

zarate commented Dec 21, 2012

Can compile the simple code below (Arduino 1.0.2, Ubuntu 12.04).:

#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {  
  0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };

EthernetClient client;

void setup()
{
  Ethernet.begin(mac);
}
void loop(){}

Throws this error:

WiFi/WiFiClient.cpp
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:192,
                 from /usr/share/arduino/libraries/SPI/SPI.h:15,
                 from /usr/share/arduino/libraries/Ethernet/utility/w5100.h:14,
                 from /usr/share/arduino/libraries/Ethernet/utility/socket.h:4,
                 from /usr/share/arduino/libraries/WiFi/WiFiClient.cpp:4:
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, const char*)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:115: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, const String&)’ here
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, char)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, const char*)’ here
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, unsigned char)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, char)’ here
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, int)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, unsigned char)’ here
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, unsigned int)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, int)’ here
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, long int)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, unsigned int)’ here
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:122: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, long unsigned int)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, long int)’ here
In file included from /usr/share/arduino/libraries/SPI/SPI.h:15,
                 from /usr/share/arduino/libraries/Ethernet/utility/w5100.h:14,
                 from /usr/share/arduino/libraries/Ethernet/utility/socket.h:4,
                 from /usr/share/arduino/libraries/WiFi/WiFiClient.cpp:4:
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:196: error: declaration of C function ‘uint16_t makeWord(byte, byte)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:195: error: previous declaration ‘uint16_t makeWord(uint16_t)’ here
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:206: error: declaration of C function ‘long int random(long int)’ conflicts with
/usr/share/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../avr/include/stdlib.h:504: error: previous declaration ‘long int random()’ here
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:207: error: declaration of C function ‘long int random(long int, long int)’ conflicts with
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:206: error: previous declaration ‘long int random(long int)’ here
/usr/share/arduino/libraries/WiFi/WiFiClient.cpp: In member function ‘uint8_t WiFiClient::getFirstSocket()’:
/usr/share/arduino/libraries/WiFi/WiFiClient.cpp:177: error: ‘SOCK_NOT_AVAIL’ was not declared in this scope
make: *** [.build/uno/WiFi/WiFiClient.o] Error 1
Make failed with code 2
@nkrkv
Copy link
Member

nkrkv commented Dec 22, 2012

Hello! Thanks for the report. It's the same as #53

@zarate
Copy link
Author

zarate commented Jan 3, 2013

Hey,

Sorry for the duplicate, will simply close and wait for 53 to be fixed then.

Cheers!

@zarate zarate closed this as completed Jan 3, 2013
@kellertobias
Copy link

Same problem still here! This is not because of the order of the includes, they are in the right order! Produces exactly the same error as above! Using most actual version of ino (Jus downloaded from github) and Ubuntu 13.10

ino build (for mega2560) produces:

#include <Arduino.h>
#include <SPI.h>
#include <Ethernet.h>
void setup();
void loop();
#line 1 "src/sketch.ino"
//#include <SPI.h>
//#include <Ethernet.h>
byte mac[] = {  
  0x11, 0x22, 0x22, 0x33, 0x44, 0x55 };

EthernetClient client;

void setup()
{
  Ethernet.begin(mac);
}
void loop(){}

@Bouni
Copy link

Bouni commented Apr 14, 2014

Hi,

I have the same problem with sketches using ethernet. I use the ino-git package from the Arch linux aur repo which is essentially the actual git version.

I try to compile the TelnetClient example from the Arduino Standart examples. Works fine with the Arduino IDE but throws a bunch of errors with ino:

$ ino build -m ethernet
WiFi/WiFiClient.cpp
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:192:0,
                 from /usr/share/arduino/libraries/SPI/SPI.h:15,
                 from /usr/share/arduino/libraries/Ethernet/utility/w5100.h:14,
                 from /usr/share/arduino/libraries/Ethernet/utility/socket.h:4,
                 from /usr/share/arduino/libraries/WiFi/WiFiClient.cpp:4:
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116:83: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, const char*)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
                                                                                   ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:115:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117:73: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, char)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
                                                                         ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const char*)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117:73: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, char)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
                                                                         ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:115:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const char*)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:115:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119:74: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
                                                                          ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119:74: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
                                                                          ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119:74: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
                                                                          ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const char*)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119:74: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
                                                                          ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:115:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120:83: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
                                                                                   ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, int)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120:83: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
                                                                                   ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120:83: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
                                                                                   ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120:83: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
                                                                                   ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const char*)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120:83: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
                                                                                   ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:115:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121:75: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
                                                                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121:75: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
                                                                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, int)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121:75: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
                                                                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121:75: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
                                                                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121:75: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
                                                                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const char*)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121:75: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
                                                                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:115:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:122:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:121:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, long int)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:122:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:120:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:122:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:119:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, int)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:122:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:118:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:122:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:117:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, char)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:122:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:116:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const char*)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
                           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:122:84: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
  friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
                                                                                    ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:115:27: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
                           ^
In file included from /usr/share/arduino/libraries/SPI/SPI.h:15:0,
                 from /usr/share/arduino/libraries/Ethernet/utility/w5100.h:14,
                 from /usr/share/arduino/libraries/Ethernet/utility/socket.h:4,
                 from /usr/share/arduino/libraries/WiFi/WiFiClient.cpp:4:
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:196:33: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
 uint16_t makeWord(byte h, byte l);
                                 ^
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:195:10: error: previous declaration 'uint16_t makeWord(uint16_t)' here
 uint16_t makeWord(uint16_t w);
          ^
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:206:17: error: declaration of C function 'long int random(long int)' conflicts with
 long random(long);
                 ^
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:4:0,
                 from /usr/share/arduino/libraries/SPI/SPI.h:15,
                 from /usr/share/arduino/libraries/Ethernet/utility/w5100.h:14,
                 from /usr/share/arduino/libraries/Ethernet/utility/socket.h:4,
                 from /usr/share/arduino/libraries/WiFi/WiFiClient.cpp:4:
/usr/avr/include/stdlib.h:504:13: error: previous declaration 'long int random()' here
 extern long random(void);
             ^
In file included from /usr/share/arduino/libraries/SPI/SPI.h:15:0,
                 from /usr/share/arduino/libraries/Ethernet/utility/w5100.h:14,
                 from /usr/share/arduino/libraries/Ethernet/utility/socket.h:4,
                 from /usr/share/arduino/libraries/WiFi/WiFiClient.cpp:4:
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:207:23: error: declaration of C function 'long int random(long int, long int)' conflicts with
 long random(long, long);
                       ^
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:206:6: error: previous declaration 'long int random(long int)' here
 long random(long);
      ^
/usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:207:23: error: declaration of C function 'long int random(long int, long int)' conflicts with
 long random(long, long);
                       ^
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:4:0,
                 from /usr/share/arduino/libraries/SPI/SPI.h:15,
                 from /usr/share/arduino/libraries/Ethernet/utility/w5100.h:14,
                 from /usr/share/arduino/libraries/Ethernet/utility/socket.h:4,
                 from /usr/share/arduino/libraries/WiFi/WiFiClient.cpp:4:
/usr/avr/include/stdlib.h:504:13: error: previous declaration 'long int random()' here
 extern long random(void);
             ^
/usr/share/arduino/libraries/WiFi/WiFiClient.cpp: In member function 'uint8_t WiFiClient::getFirstSocket()':
/usr/share/arduino/libraries/WiFi/WiFiClient.cpp:177:12: error: 'SOCK_NOT_AVAIL' was not declared in this scope
     return SOCK_NOT_AVAIL;
            ^
.build/ethernet/Makefile:156: recipe for target '.build/ethernet/WiFi/WiFiClient.o' failed
make: *** [.build/ethernet/WiFi/WiFiClient.o] Error 1
Make failed with code 2

Any Idea what to do?

@jhagberg
Copy link

I have the same issue .Just cloned the git repo. Is there a workaround for the ethernet. Works great in ARduino IDE

@richard-scott
Copy link

A fix may be to edit WiFiClient.cpp and change this:

#include "socket.h"

to this

#include "utility/socket.h"

I can compile after that.

SOCK_NOT_AVAIL is declared in socket.h :-)

@Bouni
Copy link

Bouni commented Jun 24, 2014

Hi,

I've just tested this workaround and can confirm it works!

Thank you so much Richard!

@jhagberg
Copy link

Thanks!

ino clean and ino build now works and I can compile my sketch! Great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants