zhouhan0126 / WIFIMANAGER-ESP32

wifimanager-esp32
MIT License
401 stars 135 forks source link

Compilation error: 'unique_ptr' in namespace 'std' does not name a template type #16

Open jeffpkamp opened 5 years ago

jeffpkamp commented 5 years ago

Here is my script (just trying to get this to work with esp32).

Error is below. I think that majority of it is traced back to an error which is something like 'function' in namespace 'std' does not name a template type where you can replace function with uniq_pointer or one or two other things. I saw that this is usually a problem when #include <memory> is not included, but I have checked and this is not the case for any of the libraries there error is occurring in.

Arduino: 1.6.7 (Windows 10), Board: "WEMOS LOLIN32, 80MHz, Default, 921600"

In file included from G:\Google Drive\Arduino\libraries\WiFiManager/memory:50:0,

                 from G:\Google Drive\Arduino\fthis\fthis.ino:1:

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:329:37: error: expected ')' before '<' token

         __shared_count(std::auto_ptr<_Tp>& __r)

                                     ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:591:35: error: expected ')' before '<' token

         __shared_ptr(std::auto_ptr<_Tp1>& __r)

                                   ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:636:19: error: 'auto_ptr' is not a member of 'std'

         operator=(std::auto_ptr<_Tp1>& __r)

                   ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:636:37: error: expected primary-expression before '>' token

         operator=(std::auto_ptr<_Tp1>& __r)

                                     ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:636:40: error: '__r' was not declared in this scope

         operator=(std::auto_ptr<_Tp1>& __r)

                                        ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:636:43: error: declaration of 'operator=' as non-function

         operator=(std::auto_ptr<_Tp1>& __r)

                                           ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:1013:33: error: expected ')' before '<' token

         shared_ptr(std::auto_ptr<_Tp1>& __r)

                                 ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:1040:19: error: 'auto_ptr' is not a member of 'std'

         operator=(std::auto_ptr<_Tp1>& __r)

                   ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:1040:37: error: expected primary-expression before '>' token

         operator=(std::auto_ptr<_Tp1>& __r)

                                     ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:1040:40: error: '__r' was not declared in this scope

         operator=(std::auto_ptr<_Tp1>& __r)

                                        ^

g:\google drive\arduino\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0\tr1\shared_ptr.h:1040:43: error: declaration of 'operator=' as non-function

         operator=(std::auto_ptr<_Tp1>& __r)

                                           ^

In file included from G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/WiFiSTA.h:28:0,

                 from G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/WiFi.h:32,

                 from G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/ETH.h:24,

                 from G:\Google Drive\Arduino\fthis\fthis.ino:2:

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/WiFiGeneric.h:32:14: error: 'function' in namespace 'std' does not name a template type

 typedef std::function<void(system_event_id_t event, system_event_info_t info)> WiFiEventFuncCb;

              ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/WiFiGeneric.h:74:29: error: 'WiFiEventFuncCb' has not been declared

     wifi_event_id_t onEvent(WiFiEventFuncCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX);

                             ^

In file included from G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/WiFi.h:37:0,

                 from G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/ETH.h:24,

                 from G:\Google Drive\Arduino\fthis\fthis.ino:2:

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/WiFiClient.h:36:10: error: 'shared_ptr' in namespace 'std' does not name a template type

     std::shared_ptr<WiFiClientSocketHandle> clientSocketHandle;

          ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WiFi\src/WiFiClient.h:37:10: error: 'shared_ptr' in namespace 'std' does not name a template type

     std::shared_ptr<WiFiClientRxBuffer> _rxBuffer;

          ^

In file included from G:\Google Drive\Arduino\fthis\fthis.ino:15:0:

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:86:16: error: 'function' in namespace 'std' does not name a template type

   typedef std::function<void(void)> THandlerFunction;

                ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:87:30: error: 'THandlerFunction' has not been declared

   void on(const String &uri, THandlerFunction handler);

                              ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:88:49: error: 'THandlerFunction' has not been declared

   void on(const String &uri, HTTPMethod method, THandlerFunction fn);

                                                 ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:89:49: error: 'THandlerFunction' has not been declared

   void on(const String &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);

                                                 ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:89:70: error: 'THandlerFunction' has not been declared

   void on(const String &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);

                                                                      ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:92:19: error: 'THandlerFunction' has not been declared

   void onNotFound(THandlerFunction fn);  //called when handler is not assigned

                   ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:93:21: error: 'THandlerFunction' has not been declared

   void onFileUpload(THandlerFunction fn); //handle file uploads

                     ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:177:3: error: 'THandlerFunction' does not name a type

   THandlerFunction _notFoundHandler;

   ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:178:3: error: 'THandlerFunction' does not name a type

   THandlerFunction _fileUploadHandler;

   ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:185:8: error: 'unique_ptr' in namespace 'std' does not name a template type

   std::unique_ptr<HTTPUpload> _currentUpload;

        ^

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h: In member function 'HTTPUpload& WebServer::upload()':

G:\Google Drive\Arduino\hardware\espressif\esp32\libraries\WebServer\src/WebServer.h:98:34: error: '_currentUpload' was not declared in this scope

   HTTPUpload& upload() { return *_currentUpload; }

                                  ^

In file included from G:\Google Drive\Arduino\fthis\fthis.ino:16:0:

G:\Google Drive\Arduino\libraries\WiFiManager/WiFiManager.h: At global scope:

G:\Google Drive\Arduino\libraries\WiFiManager/WiFiManager.h:127:10: error: 'unique_ptr' in namespace 'std' does not name a template type

     std::unique_ptr<DNSServer>        dnsServer;

          ^

G:\Google Drive\Arduino\libraries\WiFiManager/WiFiManager.h:131:10: error: 'unique_ptr' in namespace 'std' does not name a template type

     std::unique_ptr<WebServer>        server;

          ^

exit status 1
Error compiling.
#include <ETH.h>
#include <WiFi.h>
#include <WiFiAP.h>
#include <WiFiClient.h>
#include <WiFiGeneric.h>
#include <WiFiMulti.h>
#include <WiFiScan.h>
#include <WiFiServer.h>
#include <WiFiSTA.h>
#include <WiFiType.h>
#include <WiFiUdp.h>
#include <DNSServer.h>
#include <HTTP_Method.h>
#include <WebServer.h>
#include <WiFiManager.h>

void setup(){
  Serial.begin(9600);
}

void loop(){
  Serial.println("hello");
  delay(5000);
}