pubsubclient
pubsubclient copied to clipboard
identifier "strnlen" is undefined on VSCode PlatformIO
I have install this library, and compiled my project successfully, but I am wondering why have this issue in PubSubClient.cpp? [{ "resource": "/C:/qwer/.pio/libdeps/esp12e/PubSubClient/src/PubSubClient.cpp", "message": "identifier "strnlen" is undefined", "source": "C/C++", "startLineNumber": 235, }]
#include <string.h>
or paste this
size_t strnlen (const char *, size_t);
Mine works by Configuring the IntelliSense for C/C++ at Compiler Arguments and adding the compiler flag below.
I add the same problem and I found out that using -std=gnu++11 compiler flag solves it.