Adding these include statements at the top of the library example ...
#include <Particle.h>
#include <softap_http.h>
// original example follows here
... produces these errors
In file included from lib/Adafruit_ILI9341/src/Adafruit_ILI9341.h:21:0,
from src/___graphicstest.cpp:5:
./inc/Arduino.h:22:2: error: #error isnan is not defined please ensure this header is included before any STL headers
#error isnan is not defined please ensure this header is included before any STL headers
^
In file included from lib/Adafruit_ILI9341/src/Adafruit_ILI9341.h:21:0,
from src/___graphicstest.cpp:5:
./inc/Arduino.h:173:1: error: expected ';' before 'using'
using std::isinf
^
./inc/Arduino.h:210:1: error: expected ';' before 'typedef'
typedef USARTSerial HardwareSerial;
^
However the errors go away when adding #include <Arduino.h> like this
In file included from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/vector:64:0,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/random.h:34,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/random:49,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_algo.h:66,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/algorithm:62,
from ../hal/src/photon/softap_http.h:13,
from src/___graphicstest.cpp:5:
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1194:23: error: macro "swap" requires 2 arguments, but only 1 given
swap(vector& __x)
^
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1559:60: error: macro "swap" passed 4 arguments, but takes just 2
swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
^
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1560:19: error: macro "swap" requires 2 arguments, but only 1 given
{ __x.swap(__y); }
^
In file included from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/vector:65:0,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/random.h:34,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/random:49,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_algo.h:66,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/algorithm:62,
from ../hal/src/photon/softap_http.h:13,
from src/___graphicstest.cpp:5:
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_bvector.h:930:21: error: macro "swap" requires 2 arguments, but only 1 given
swap(vector& __x)
^
In file included from src/___graphicstest.cpp:3:0:
lib/Adafruit_mfGFX/src/Adafruit_mfGFX.h:17:20: error: expected unqualified-id before '{' token
#define swap(a, b) { int16_t t = a; a = b; b = t; }
^
In file included from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_algo.h:60:0,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/algorithm:62,
from ../hal/src/photon/softap_http.h:13,
from src/___graphicstest.cpp:5:
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/algorithmfwd.h:573:5: error: expected unqualified-id before 'noexcept'
noexcept(__and_<is_nothrow_move_constructible<_Tp>,
^
In file included from src/___graphicstest.cpp:3:0:
lib/Adafruit_mfGFX/src/Adafruit_mfGFX.h:17:20: error: expected unqualified-id before '{' token
#define swap(a, b) { int16_t t = a; a = b; b = t; }
^
In file included from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_algo.h:60:0,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/algorithm:62,
from ../hal/src/photon/softap_http.h:13,
from src/___graphicstest.cpp:5:
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/algorithmfwd.h:582:5: error: expected unqualified-id before 'noexcept'
noexcept(noexcept(swap(*__a, *__b)))
^
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/algorithmfwd.h:582:39: error: expected unqualified-id before ')' token
noexcept(noexcept(swap(*__a, *__b)))
^
In file included from src/___graphicstest.cpp:3:0:
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h: In member function 'void std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_M_swap_data(std::_Vector_base<_Tp, _Alloc>::_Vector_impl&)':
lib/Adafruit_mfGFX/src/Adafruit_mfGFX.h:17:20: error: expected unqualified-id before '{' token
#define swap(a, b) { int16_t t = a; a = b; b = t; }
^
lib/Adafruit_mfGFX/src/Adafruit_mfGFX.h:17:20: error: expected unqualified-id before '{' token
#define swap(a, b) { int16_t t = a; a = b; b = t; }
^
lib/Adafruit_mfGFX/src/Adafruit_mfGFX.h:17:20: error: expected unqualified-id before '{' token
#define swap(a, b) { int16_t t = a; a = b; b = t; }
^
In file included from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/vector:64:0,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/random.h:34,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/random:49,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_algo.h:66,
from /usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/algorithm:62,
from ../hal/src/photon/softap_http.h:13,
from src/___graphicstest.cpp:5:
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h: At global scope:
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1194:7: error: variable or field 'swap' declared void
swap(vector& __x)
^
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1194:7: error: expected ';' at end of member declaration
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1196:7: error: expected unqualified-id before 'noexcept'
noexcept(_Alloc_traits::_S_nothrow_swap())
^
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1559:5: error: variable or field 'swap' declared void
swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
^
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1560:7: error: '__x' was not declared in this scope
{ __x.swap(__y); }
^
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1560:20: error: expected '}' before ';' token
{ __x.swap(__y); }
^
/usr/local/gcc-arm-embedded/arm-none-eabi/include/c++/5.3.1/bits/stl_vector.h:1563:1: error: expected declaration before '}' token
} // namespace std
^
Adding these include statements at the top of the library example ...
... produces these errors
However the errors go away when adding
#include <Arduino.h>
like thisHowever, rearranging the includes like this ...
... causes a plathora of other errors
Building with Web IDE for Photon 1.0.1