I just got an Adafruit Airlift featherwing, and I compiled the ScanNetworks example program. It compiles fine for the Teensy 3.6, but it gives the following error for Teensy 4.0. I have tried both Teensydunio 1.49 with Arduino 1.8.10 and Teensydunio 1.50 beta1 with Arduino 1.8.11.
Here is the Adafruit version of the WiFiNANA library that includes pin definitions for the various Featherwings:
Here is the error:
Code:
Arduino: 1.8.11 (Linux), TD: 1.50-beta1, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"
In file included from /rock/shared/arduino/teensy-1.50beta1-1.8.11/hardware/teensy/avr/cores/teensy4/IPAddress.h:29:0,
from /home/meissner/Arduino/libraries/Adafruit_WiFiNINI/utility/wifi_drv.h:26,
from /home/meissner/Arduino/libraries/Adafruit_WiFiNINI/WiFi.cpp:21:
/rock/shared/arduino/teensy-1.50beta1-1.8.11/hardware/teensy/avr/cores/teensy4/Printable.h:37:13: error: 'size_t' does not name a type
virtual size_t printTo(Print& p) const = 0;
^
In file included from /rock/shared/arduino/teensy-1.50beta1-1.8.11/hardware/teensy/avr/cores/teensy4/Stream.h:24:0,
from /rock/shared/arduino/teensy-1.50beta1-1.8.11/hardware/teensy/avr/cores/teensy4/Udp.h:40,
from /home/meissner/Arduino/libraries/Adafruit_WiFiNINI/WiFiUdp.h:24,
from /home/meissner/Arduino/libraries/Adafruit_WiFiNINI/utility/wifi_drv.h:27,
from /home/meissner/Arduino/libraries/Adafruit_WiFiNINI/WiFi.cpp:21:
/rock/shared/arduino/teensy-1.50beta1-1.8.11/hardware/teensy/avr/cores/teensy4/Print.h: In member function 'size_t Print::print(const Printable&)':
/rock/shared/arduino/teensy-1.50beta1-1.8.11/hardware/teensy/avr/cores/teensy4/Print.h:82:51: error: 'const class Printable' has no member named 'printTo'
size_t print(const Printable &obj) { return obj.printTo(*this); }
^
/rock/shared/arduino/teensy-1.50beta1-1.8.11/hardware/teensy/avr/cores/teensy4/Print.h: In member function 'size_t Print::println(const Printable&)':
/rock/shared/arduino/teensy-1.50beta1-1.8.11/hardware/teensy/avr/cores/teensy4/Print.h:102:53: error: 'const class Printable' has no member named 'printTo'
size_t println(const Printable &obj) { return obj.printTo(*this) + println(); }
^
Error compiling for board Teensy 4.0.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Now, if I go into hardware/teensy/avr/cores/teensy4/Printable.h, and add an include of 'stdlib.h', the example compiles file. But the Teensy 3 version does not need this. If you look at the Teensy3 version, it includes 'new.h', and inside of 'new.h' is an include of 'stdlib.h'. In the Teensy4 version, it does not include 'new.h' (and in fact 'new.h' no longer exists in the Teensy4 directory).
So either 'Printable.h' needs to include 'stdlib.h' or whatever includes it needs to include the file.