esp32-c3 compile time error

pankaj21
Posts: 3
Joined: Thu Feb 18, 2021 3:09 pm

esp32-c3 compile time error

Postby pankaj21 » Mon Jun 21, 2021 6:24 pm

I am getting the following error code when I compile our code using the esp32c3 cmake file:
.espressif\tools\riscv32-esp-elf\1.24.0.123_64eb9ff-8.4.0\riscv32-esp-elf\riscv32-esp-elf\include\c++\8.4.0\cstdlib:232:11: error: '::strtold' has not been declared
using ::strtold;

My code has a combination of .c & .c++ files. The above error message shows up in all the files. I am using IDF v4.3(stable released version). I am already doing the foll. in my code:
#ifdef __cplusplus
extern "C"
{
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include
}
#endif

Any thoughts on how to resolve this error?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: esp32-c3 compile time error

Postby ESP_Angus » Tue Jun 22, 2021 5:00 am

Try removing the extern "C" guards totally and include the C++ versions of these headers:

Code: Select all

#include <cstdio>
#include <cstring>
#include <cstdlib>
EDIT: I'm not able to reproduce this with just the snippet of code you posted. Can you give a source file that's enough to reproduce the error, and also the full build output when it fails? Thanks.

pankaj21
Posts: 3
Joined: Thu Feb 18, 2021 3:09 pm

Re: esp32-c3 compile time error

Postby pankaj21 » Tue Jun 22, 2021 7:07 pm

Removed the C guards and replaced the header files with C++ header files however still having that issue.
It is part of our platform code hence cannot share it here however I created a small project with the files from which I was getting the error message but was not able to recreate it.
Any other ideas on how to resolve the error?

Who is online

Users browsing this forum: Gaston1980, Google [Bot] and 214 guests