pkourany / Adafruit_ILI9341_IDE

Adafruit ILI9341 library using mfGFX adapted for Particle
Other
2 stars 1 forks source link

Strange incompatibility with SoftAP #1

Open ScruffR opened 5 years ago

ScruffR commented 5 years ago

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

#include <Particle.h>
#include <Arduino.h>
#include <softap_http.h>

However, rearranging the includes like this ...

#include <Particle.h>
#include <Arduino.h>
#include "Adafruit_mfGFX.h"
#include "Adafruit_ILI9341.h"
#include <softap_http.h>

... causes a plathora of other errors

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
 ^

Building with Web IDE for Photon 1.0.1

tmm1 commented 4 years ago

I noticed this also when using clang-format --sort-includes

tmm1 commented 4 years ago

This seems to be due to https://github.com/pkourany/Adafruit_mfGFX_IDE/issues/1