PlatformIO Community

Libraries not detected "cannot open source file"

hello, sorry if this has been asked before
i’m trying to use libraries from tensorflow followed by this article

there’s some slight modification to the steps since the new tensorflow lite is no longer an experimental

i moved all the libs from the compilation to the “lib” folder in the project you can see the structure below

and after doing that i tried to include the libs but it doesn’t recognized by the IDE
i tried to compile it anyway but i got error saying “no such file or dirrectory”

did i placed the libs incorrectly ?
i changed the lib_ldf_mode = deep still didnt fix it

English is not my main language sorry if there’s some part you didn’t understand, really apreciate help from this community thankyou

Their sample project is up at and you can look at the folder structure there. It’s different to yours since it has lib/tfmicro/tensorflow/lite in it, but you’re doing lib/tensorflow/lite/micro.

1 Like

i make some adjustment according to the GitHub Page turns out the problem is because i didn’t include the

libs_deps = tfmicro

in platformio.ini

the dependency is now fixed but i got another problem, i think it has to do with the toolchain the error
the code looks like this


the problem


and the compile log

tried to change the “include” with
#include <tgmath.h>
i get more errors instead

So have you just tried enabling the other codepath and use std::max instead of std::fmax. Because that at least auto-completes for me in the ESP32 environment.

Adding something like || defined(ARDUINO) would suffice in the #if defined check expresson. Or ARDUINO_ARCH_ESP32 if you want to be precise and limiting to ESP32-Arduino.

Same for fmin().

1 Like

adding the defined(arduino) fixed the problem for me thankyou