using <cstring> header in IDF v4.1
Posted: Tue Nov 03, 2020 12:24 pm
Hi all,
The search is broken on this site, so I was unable to seach for this question.
I have a ESP32 C++ project, running on IDF version 4.1.
When I include the <cstring> header like so:
I get the following errors:
What am I doing wrong here?
I also tried including just "string.h", but that causes it to say:
The search is broken on this site, so I was unable to seach for this question.
I have a ESP32 C++ project, running on IDF version 4.1.
When I include the <cstring> header like so:
Code: Select all
#include <cstring>
/**
* Main entry point application
*/
void app_main()
{
char foo[100];
strncpy(foo, "test", sizeof(foo));
}
Code: Select all
In file included from /home/peter/esp/levelmeasurement/main/main.cpp:24:
/home/peter/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.2.0/cstring:75:11: error: '::memchr' has not been declared
using ::memchr;
^~~~~~
/home/peter/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.2.0/cstring:76:11: error: '::memcmp' has not been declared
using ::memcmp;
^~~~~~
/home/peter/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.2.0/cstring:77:11: error: '::memcpy' has not been declared
using ::memcpy;
^~~~~~
/home/peter/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.2.0/cstring:78:11: error: '::memmove' has not been declared
using ::memmove;
^~~~~~~
/home/peter/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.2.0/cstring:79:11: error: '::memset' has not been declared
using ::memset;
... etc.
I also tried including just "string.h", but that causes it to say:
Code: Select all
'strncpy' is defined in header '<cstring>'; did you forget to '#include <cstring>'?