amperka / ino

Command line toolkit for working with Arduino hardware
http://inotool.org
MIT License
1.08k stars 233 forks source link

WifiShield ScanNetworks example build fails #191

Closed visibilityspots closed 9 years ago

visibilityspots commented 9 years ago

Hi,

I'm trying to build the scannetworks example for the wifi arduino shield using archlinux and the lastest stable ino version.

But I got stuck on a cryptical error to me:

  $ ino build
  Scanning dependencies of src
  WiFi/utility/socket.c
  WiFi/utility/spi_drv.cpp
  WiFi/utility/server_drv.cpp
  WiFi/utility/wifi_drv.cpp
  WiFi/WiFiServer.cpp
  WiFi/WiFiClient.cpp
  WiFi/WiFiUdp.cpp
  WiFi/WiFi.cpp
  Linking libWiFi.a
  Ethernet/Ethernet.cpp
  Ethernet/EthernetServer.cpp
  In file included from /usr/local/share/arduino/libraries/Ethernet/EthernetServer.cpp:2:0:
  /usr/local/share/arduino/libraries/WiFi/utility/socket.h:70:19: error: conflicting declaration 'typedef   uint16_t SOCKET'
   typedef uint16_t  SOCKET;
                   ^
  In file included from /usr/local/share/arduino/libraries/Ethernet/EthernetServer.cpp:1:0:
  /usr/local/share/arduino/libraries/Ethernet/utility/w5100.h:18:17: note: previous declaration as   'typedef uint8_t SOCKET'
 typedef uint8_t SOCKET;
                 ^
  /usr/local/share/arduino/libraries/Ethernet/EthernetServer.cpp: In member function 'virtual void   EthernetServer::begin()':
  /usr/local/share/arduino/libraries/Ethernet/EthernetServer.cpp:21:39: error: too many arguments to function 'SOCKET socket(uint8)'
       socket(sock, SnMR::TCP, _port, 0);
                                       ^
  In file included from /usr/local/share/arduino/libraries/Ethernet/EthernetServer.cpp:2:0:
  /usr/local/share/arduino/libraries/WiFi/utility/socket.h:75:15: note: declared here
   extern SOCKET socket(uint8 protocol); // Opens a socket(TCP or UDP or IP_RAW mode)
               ^
  .build/leonardo/Makefile:97: recipe for target '.build/leonardo/Ethernet/EthernetServer.o' failed
  make: *** [.build/leonardo/Ethernet/EthernetServer.o] Error 1
  Make failed with code 2

Running it through the arduino ide it compiles without any issue.. Anyone who has an idea what I'm doeing wrong?

Thanks in advance!

visibilityspots commented 9 years ago

Seems like the Wifi and Ethernet libraries are conflicting. Since I'm not going to use the Ethernet library I moved it into a tar.gz file and removed the /usr/local/share/arduino/libraries/Ethernet directory.

Now it works without any issue.