求助ESP8266编译问题-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1167|回复: 0

求助ESP8266编译问题

[复制链接]
发表于 2020-6-7 11:01 | 显示全部楼层 |阅读模式
我买了一块WeMos D1,基本的环境配置后,编译示例代码,却提示编译错误,产看错误信息,发现是编译器识别不了库里面的一些类型 、变量,求助各位大神,烦请指导!=========================================================================================================
Arduino:1.8.4 (Windows 10), 开发板:"WeMos D1 R1, 80 MHz, Flash,Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MBOTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
In file included fromC:\MinGW\include\c++\3.4.5/cmath:50:0,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Arduino.h:239,
                 fromsketch\WiFiScan.ino.cpp:1:
C:\MinGW\include\c++\3.4.5/bits/cpp_type_traits.h:334:12:error: expected identifier before '__is_pod'
    struct __is_pod
           ^
C:\MinGW\include\c++\3.4.5/bits/cpp_type_traits.h:334:12:error: expected unqualified-id before '__is_pod'
In file included from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Arduino.h:247:0,
                 fromsketch\WiFiScan.ino.cpp:1:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Updater.h:53:13:error: 'function' in namespace 'std' does not name a type
    typedef std::function<void(size_t, size_t)>THandlerFunction_Progress;
            ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Updater.h:122:19:error: expected ';' at end of member declaration
    UpdaterClass& onProgress(THandlerFunction_Progress fn);
                   ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Updater.h:122:56:error: expected ')' before 'fn'
    UpdaterClass& onProgress(THandlerFunction_Progress fn);
                                                       ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Updater.h:205:5:error: 'THandlerFunction_Progress' does not name a type
    THandlerFunction_Progress _progress_callback;
    ^
In file included from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.h:28:0,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFi.h:34,
                 from C:\Users\璐捐崳杈塡AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\examples\WiFiScan\WiFiScan.ino:6:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:41:9:error: 'shared_ptr' in namespace 'std' does not name a type
typedefstd::shared_ptr<WiFiEventHandlerOpaque> WiFiEventHandler;
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:67:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandler onStationModeConnected(std::function<void(constWiFiEventStationModeConnected&)>);
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:68:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandler onStationModeDisconnected(std::function<void(const WiFiEventStationModeDisconnected&)>);
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:69:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandler onStationModeAuthModeChanged(std::function<void(constWiFiEventStationModeAuthModeChanged&)>);
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:70:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandler onStationModeGotIP(std::function<void(constWiFiEventStationModeGotIP&)>);
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:71:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandleronStationModeDHCPTimeout(std::function<void(void)>);
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:72:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandleronSoftAPModeStationConnected(std::function<void(constWiFiEventSoftAPModeStationConnected&)>);
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:73:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandleronSoftAPModeStationDisconnected(std::function<void(constWiFiEventSoftAPModeStationDisconnected&)>);
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:74:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandleronSoftAPModeProbeRequestReceived(std::function<void(constWiFiEventSoftAPModeProbeRequestReceived&)>);
        ^
In file included from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.h:28:0,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFi.h:34,
                 from C:\Users\璐捐崳杈塡AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\examples\WiFiScan\WiFiScan.ino:6:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:75:9:error: 'WiFiEventHandler' does not name a type
        WiFiEventHandler onWiFiModeChange(std::function<void(constWiFiEventModeChange&)>);
        ^
In file included from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFi.h:36:0,
                 from C:\Users\璐捐崳杈塡AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\examples\WiFiScan\WiFiScan.ino:6:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiScan.h:38:37:error: 'std::function' has not been declared
        void scanNetworksAsync(std::function<void(int)> onComplete, boolshow_hidden = false);
                                     ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiScan.h:38:45:error: expected ',' or '...' before '<' token
        void scanNetworksAsync(std::function<void(int)> onComplete, boolshow_hidden = false);
                                             ^
In file included from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFi.h:36:0,
                 from C:\Users\璐捐崳杈塡AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\examples\WiFiScan\WiFiScan.ino:6:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFiScan.h:63:16:error: 'function' in namespace 'std' does not name a type
         static std::function<void(int)>_onComplete;
                ^
In file included from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/CertStoreBearSSL.h:26:0,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:30,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecure.h:41,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiServerSecure.h:20,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFi.h:41,
                 from C:\Users\璐捐崳杈塡AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\examples\WiFiScan\WiFiScan.ino:6:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:37:9:error: 'shared_ptr' in namespace 'std' does not name a type
typedef std::shared_ptr<FileImpl>FileImplPtr;
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:39:9:error: 'shared_ptr' in namespace 'std' does not name a type
typedef std::shared_ptr<FSImpl> FSImplPtr;
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:41:9:error: 'shared_ptr' in namespace 'std' does not name a type
typedef std::shared_ptr<DirImpl>DirImplPtr;
        ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:55:22:error: expected ')' before 'p'
    File(FileImplPtr p = FileImplPtr(), FS *baseFS = nullptr) : _p(p),_fakeDir(nullptr), _baseFS(baseFS) { }
                      ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:119:5:error: 'FileImplPtr' does not name a type
    FileImplPtr _p;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:122:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<Dir> _fakeDir;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:128:20:error: expected ')' before 'impl'
    Dir(DirImplPtr impl = DirImplPtr(), FS *baseFS = nullptr): _impl(impl),_baseFS(baseFS) { }
                    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:145:5:error: 'DirImplPtr' does not name a type
    DirImplPtr _impl;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:200:18:error: expected ')' before 'impl'
    FS(FSImplPtr impl) : _impl(impl) { timeCallback = _defaultTimeCB; }
                  ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:240:5:error: 'FSImplPtr' does not name a type
    FSImplPtr _impl;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/FS.h:241:5:error: 'FSImplPtr' does not name a type
    FSImplPtr getImpl() { return _impl; }
    ^
In file included from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecure.h:41:0,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiServerSecure.h:20,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFi.h:41,
                 from C:\Users\璐捐崳杈塡AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\examples\WiFiScan\WiFiScan.ino:6:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:203:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<br_ssl_client_context> _sc;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:204:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<br_ssl_server_context> _sc_svr;
     ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:209:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<br_x509_minimal_context> _x509_minimal;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:210:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<struct br_x509_insecure_context> _x509_insecure;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:211:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<br_x509_knownkey_context> _x509_knownkey;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:212:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<unsigned char> _iobuf_in;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:213:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<unsigned char> _iobuf_out;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:226:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<X509List>  _axtls_ta;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:227:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<X509List>  _axtls_chain;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:228:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<PrivateKey> _axtls_sk;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:242:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<uint16_t> _cipher_list;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:In member function 'bool BearSSL::WiFiClientSecure::ctx_present()':
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:206:15:error: '_sc' was not declared in this scope
      return (_sc != nullptr) || (_sc_svr != nullptr);
               ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiClientSecureBearSSL.h:206:35:error: '_sc_svr' was not declared in this scope
      return (_sc != nullptr) || (_sc_svr != nullptr);
                                   ^
In file included from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiServerSecure.h:23:0,
                 from C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/ESP8266WiFi.h:41,
                 from C:\Users\璐捐崳杈塡AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\examples\WiFiScan\WiFiScan.ino:6:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiServerSecureBearSSL.h:At global scope:
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiServerSecureBearSSL.h:78:5:error: 'shared_ptr' in namespace 'std' does not name a type
     std::shared_ptr<X509List>   _axtls_chain;
    ^
C:\Users\***\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266WiFi\src/WiFiServerSecureBearSSL.h:79:5:error: 'shared_ptr' in namespace 'std' does not name a type
    std::shared_ptr<PrivateKey> _axtls_sk;
    ^
exit status 1
为开发板 WeMos D1 R1 编译时出错。



您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 00:54 , Processed in 0.276572 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表