Search code examples
arduinoarduino-c++

Is it possible to add libstdc to arduino-ide


I'm using TensorFlow lite and it need to include the libstdc mode specifically cstddef but the Arduino IDE is not able to fine any of the libstdc. I know they are installed because i searcher in the PC and they are in /usr/include/c++/8.

if i change the cstddef in stddef.h it work flawlessly.

home/jan/Arduino/libraries/hello_world/src/third_party/flatbuffers/include/flatbuffers/base.h:31:19: fatal error: cstddef: No such file or directory


Solution

  • You should not need any component of libstdc at all:

    from https://www.tensorflow.org/lite/microcontrollers/overview

    TensorFlow Lite for Microcontrollers

    TensorFlow Lite for Microcontrollers is an experimental port of TensorFlow Lite aimed at microcontrollers and other devices with only kilobytes of memory.

    It is designed to be portable even to "bare metal" systems, so it doesn't require operating system support, any standard C or C++ libraries, or dynamic memory allocation

    Also:

    • If you write code for Arduino, what you can find in /usr/include/..., is VERY RARELY what you're searching for, because that stuff is meant to compile for your computer, not a microcontroller
    • Arduino has it's own library tree and library manager, you should always start by checking these
    • Then, only if you are REALLY SURE to need a libstdc++ implementation for Arduino, you want to check this: https://cxx.uclibc.org/faq.html