没有用于调用SocketIOClient :: SocketIOClient()的匹配函数

时间:2017-04-06 15:03:14

标签: c++ node.js socket.io arduino

我试图使用SocketIO维护节点JS服务器和Arduino之间的通信,我试图测试这个例子(arduinoChat)https://github.com/quentinpigne/socket.io-arduino-client我得到了这个错误:

  arduinochat.ino:6:16: error: no matching function for call to ‘SocketIOClient::SocketIOClient()’
    arduinochat.ino:6:16: note: candidates are:
    In file included from arduinochat.ino:4:0:
    /home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:52:3: note: SocketIOClient::SocketIOClient(Client&)
       SocketIOClient(Client& client);
       ^
    /home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:52:3: note:   candidate expects 1 argument, 0 provided
    /home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:50:7: note: SocketIOClient::SocketIOClient(const SocketIOClient&)
     class SocketIOClient {
           ^
    /home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:50:7: note:   candidate expects 1 argument, 0 provided
    arduinochat.ino: In function ‘void setup()’:
    arduinochat.ino:30:55: error: invalid conversion from ‘void (*)(EthernetClient, char*)’ to ‘void (*)(Client&, ArduinoJson::JsonArray&)’ [-fpermissive]
    In file included from arduinochat.ino:4:0:
    /home/nourhene/sketchbook/libraries/SocketIOClient/SocketIOClient.h:56:8: note: initializing argument 2 of ‘void SocketIOClient::setEventHandler(char*, void (*)(Client&, ArduinoJson::JsonArray&))’
       void setEventHandler(char* eventName, void (*handler)(Client& client, JsonArray& data));
            ^

arduinochat.ino:6:16 =>

SocketIOClient client;

SocketIOClient.h:52:3:=>

class SocketIOClient {
    public:
        SocketIOClient(Client& client);

0 个答案:

没有答案