C++ library issues


Bharath V <bharath.vkrishna@...>
 

Dear Team

I am currently working on implementing Tensorflow lite on RISC-V (LiteX vexRISC-V) using Zephyr RTOS. I have successfully installed Zephyr RTOS (with SDK) and am able to run the blinky program. I am facing an issue with the C++ libraries while using tensorflow lite. I not able to include cstdarg library in tensorflow lite libraries or the main.c program. The exact issue is mentioned below.

-----------------------------------------------------------------

/home/bharath/zephyrproject/zephyr/hello_world/src/main.c:8:10: fatal error: cstdarg: No such file or directory
    8 | #include <cstdarg>
      |          ^~~~~~~~~
compilation terminated.

-----------------------------------------------------------------

I am using the west utility to build the code. Kindly requesting for assistance.

Thanks and regards
Bharath V


artur.lipowski@...
 

Hi,

Did you try to rename main.c to main.cpp?

Regards,
Artur


Guy Morand
 

Hi Baharath,

I also struggle a little to get cpp running, I needed the following configuration in my project to make it work:
CONFIG_NEWLIB_LIBC=y
CONFIG_CPLUSPLUS=y
CONFIG_STD_CPP20=y
CONFIG_LIB_CPLUSPLUS=y

Regards,

Guy

On 16/02/2022 16:42, Bharath V wrote:
Dear Team
I am currently working on implementing Tensorflow lite on RISC-V (LiteX vexRISC-V) using Zephyr RTOS. I have successfully installed Zephyr RTOS (with SDK) and am able to run the blinky program. I am facing an issue with the C++ libraries while using tensorflow lite. I not able to include cstdarg library in tensorflow lite libraries or the main.c program. The exact issue is mentioned below.
-----------------------------------------------------------------
/home/bharath/zephyrproject/zephyr/hello_world/src/main.c:8:10: fatal error: cstdarg: No such file or directory
    8 | #include <cstdarg>
      |          ^~~~~~~~~
compilation terminated.
-----------------------------------------------------------------
I am using the west utility to build the code. Kindly requesting for assistance.
Thanks and regards
Bharath V
--
bytes at work
Technoparkstrasse 7
CH-8406 Winterthur
Switzerland

phone: +41 52 213 79 79