示例编译不通过-Arduino中文社区 - Powered by Discuz! Archiver

csclee 发表于 2019-4-27 14:37

示例编译不通过

本帖最后由 csclee 于 2019-4-27 15:04 编辑

基本信息
[*][] 这个问题满足提问指南
[*][] 我阅读了开发文档
[*][] 我使用了最新的库及APP进行测试,但是问题仍然存在
[*][] 我搜索过类似问题的解决方法但是仍然无法解决
[*][] 有设备端的LOG信息
[*][] 有编译报错信息
[*][] 我已填写基本信息
设备信息
[*]硬件:
[*]接入方式:
[*]package版本:
[*]blinker库版本:
[*]开发环境:
[*]操作系统:
IDE 中的设置
[*]图片ide
问题描述编译示例文件 Hello_WiFi出错代码/* ***************************************************************** * * Download latest Blinker library here: * https://github.com/blinker-iot/blinker-library/archive/master.zip * * * Blinker is a cross-hardware, cross-platform solution for the IoT. * It provides APP, device and server support, * and uses public cloud services for data transmission and storage. * It can be used in smart home, data monitoring and other fields * to help users build Internet of Things projects better and faster. * * Make sure installed 2.5.0 or later ESP8266/Arduino package, * if use ESP8266 with Blinker. * https://github.com/esp8266/Arduino/releases * * Docs: https://doc.blinker.app/ *       https://github.com/blinker-iot/blinker-doc/wiki * * ***************************************************************** * * Blinker 库下载地址: * https://github.com/blinker-iot/blinker-library/archive/master.zip * * Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、 * 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、 * 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。 * * 如果使用 ESP8266 接入 Blinker, * 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。 * https://github.com/esp8266/Arduino/releases * * 文档: https://doc.blinker.app/ *       https://github.com/blinker-iot/blinker-doc/wiki * * *****************************************************************/
#define BLINKER_WIFI
#include <Blinker.h>
char auth[] = "Your Device Secret Key";char ssid[] = "Your WiFi network SSID or name";char pswd[] = "Your WiFi network WPA password or WEP key";
// 新建组件对象BlinkerButton Button1("btn-abc");BlinkerNumber Number1("num-abc");
int counter = 0;
// 按下按键即会执行该函数void button1_callback(const String & state){    BLINKER_LOG("get button state: ", state);    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));}
// 如果未绑定的组件被触发,则会执行其中内容void dataRead(const String & data){    BLINKER_LOG("Blinker readString: ", data);    counter++;    Number1.print(counter);}
void setup(){    // 初始化串口    Serial.begin(115200);    BLINKER_DEBUG.stream(Serial);
    // 初始化有LED的IO    pinMode(LED_BUILTIN, OUTPUT);    digitalWrite(LED_BUILTIN, HIGH);    // 初始化blinker    Blinker.begin(auth, ssid, pswd);    Blinker.attachData(dataRead);
    Button1.attach(button1_callback);}
void loop() {    Blinker.run();}LOG信息无编译信息Arduino:1.8.9 (Windows XP), 开发板:"Arduino Nano, ATmega328P (Old Bootloader)"
In file included from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Blinker.h:132:0,
               from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\examples\Blinker_Hello\Hello_WiFi\Hello_WiFi.ino:40:
C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/BlinkerSerialESPMQTT.h:147:27: error: cannot declare field 'BlinkerSerialESPMQTT::Transp' to be of abstract type 'BlinkerSerialMQTT'
         BlinkerSerialMQTT Transp;
                           ^
In file included from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/BlinkerSerialESPMQTT.h:4:0,
               from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Blinker.h:132,
               from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\examples\Blinker_Hello\Hello_WiFi\Hello_WiFi.ino:40:
C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerSerialMQTT.h:26:7: note:   because the following virtual functions are pure within 'BlinkerSerialMQTT':
class BlinkerSerialMQTT : public BlinkerStream
       ^
In file included from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerSerialMQTT.h:13:0,
               from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/BlinkerSerialESPMQTT.h:4,
               from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Blinker.h:132,
               from C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\examples\Blinker_Hello\Hello_WiFi\Hello_WiFi.ino:40:
C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerStream.h:36:25: note:         virtual int BlinkerStream::bPrint(char*, const String&)
             virtual int bPrint(char * name, const String & data) = 0;
                         ^
C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerStream.h:37:25: note:         virtual int BlinkerStream::autoPrint(uint32_t)
             virtual int autoPrint(uint32_t id) = 0;
                         ^
C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerStream.h:39:25: note:         virtual int BlinkerStream::aligenieAvail()
             virtual int aligenieAvail() = 0;
                         ^
C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerStream.h:40:25: note:         virtual int BlinkerStream::duerAvail()
             virtual int duerAvail() = 0;
                         ^
C:\Documents and Settings\l\My Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerStream.h:41:25: note:         virtual int BlinkerStream::needFreshShare()
             virtual int needFreshShare() = 0;
                         ^
exit status 1为开发板 Arduino Nano 编译时出错。
在文件 -> 首选项开启“编译过程中显示详细输出”选项这份报告会包含更多信息。

csclee 发表于 2019-4-27 15:05

已解决,blinker库降到0.2.4就可以编译通过了

奈何col 发表于 2019-4-27 15:13

0.2.4早就不能用了,请在github下载最新版。一切照文档操作,是没有问题的






页: [1]
查看完整版本: 示例编译不通过