khoih-prog / WebSockets2_Generic

A WebSocket Server and Client library for Arduino, based on RFC6455, for writing modern Websockets applications. Now support ESP8266, ESP32 (including ESP32-S2 Saola, AI-Thinker ESP-12K, WT32_ETH01, etc.), nRF52, SAMD21, SAMD51, SAM DUE, STM32F/L/H/G/WB/MP1, Teensy, RP2040-based, etc. boards, with WiFiNINA, Teensy 4.1 NativeEthernet/QNEthernet, Ethernet W5x00 / ENC28J60 / LAN8742A / LAN8720, ESP8266 / ESP32-AT modules/shields, as well as SINRIC / Alexa / Google Home
GNU General Public License v3.0
81 stars 30 forks source link

Error Compiling for board MKR WiFi 1010 #46

Closed liuyinze closed 2 years ago

liuyinze commented 2 years ago

Describe the bug

I am currently trying with this library and other dependent libraries which have been installed as well. The first 2 errors are the following. I really don't know how to fix this... I didn't define the define.h as you did in the example. Is that very necessary to do this?

Actual behavior

But something wrong happened and I don't know why...

Debug and AT-command log (if applicable)

C:\Users\yil\OneDrive - Software AG\Documents\Arduino\libraries\WebSockets2_Generic\src/Tiny_Websockets_Generic/server.hpp:84:51: error: expected ')' before '' token WebsocketsServer(network2_generic::TcpServer server = new WSDefaultTcpServer); ^ C:\Users\yil\OneDrive - Software AG\Documents\Arduino\libraries\WebSockets2_Generic\src/Tiny_Websockets_Generic/server.hpp:100:25: error: 'TcpServer' in namespace 'websockets2_generic::network2_generic' does not name a type network2_generic::TcpServer* _server; ^~~~~

Information

Please ensure to specify the following:

Additional context

Add any other context about the problem here.

khoih-prog commented 2 years ago

First use an example to compile / test. After OK and being comfortable, then moving on to slowly adapt / add your code into the example. The defines.h is important, just read, understand and remove only the unnecessary portions of it.

I've just compile the SAMD_WiFi101-AdvancedWebServer example without error.

I'm closing the issue now as this is not a bug of the library, and suggest next time, post on Discussions whenever you're not certain that it's a library's bug.

Selection_022