Variable not found when build tensorflow lite library

Hello, I’m working with tensorflow lite library nodemcu32S devkit v1.
Here is my platformio.ini file

[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino
lib_deps = tfmicro

monitor_speed = 115200

Here my project structural

.pio
.vscode
include
lib
-tfmicro
--kissfft
---tools
----kiss_fftr.h
---kiss_fft.h
--tensorflow
src
test
.gitignore
platformio.ini

When I build, I get this error:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/nodemcu-32s.html
PLATFORM: Espressif 32 (3.4.0) > NodeMCU-32S
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 3.10006.210326 (1.0.6)
 - tool-esptoolpy 1.30100.210531 (3.1.0)
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <tfmicro>
Building in release mode
Linking .pio\build\nodemcu-32s\firmware.elf
.pio\build\nodemcu-32s\libb1e\libtfmicro.a(fft_util.cc.o):(.literal.FftPopulateState+0x14): undefined reference to `kiss_fftr_alloc'
.pio\build\nodemcu-32s\libb1e\libtfmicro.a(fft_util.cc.o): In function `FftPopulateState':
C:\Users\Huy\Documents\PlatformIO\Projects\micro_speech/lib\tfmicro\tensorflow\lite\experimental\microfrontend\lib/fft_util.cc:47: undefined reference to `kiss_fftr_alloc'
C:\Users\Huy\Documents\PlatformIO\Projects\micro_speech/lib\tfmicro\tensorflow\lite\experimental\microfrontend\lib/fft_util.cc:57: undefined reference to `kiss_fftr_alloc'
.pio\build\nodemcu-32s\libb1e\libtfmicro.a(fft.cc.o):(.literal.FftCompute+0x0): undefined reference to `kiss_fftr'
.pio\build\nodemcu-32s\libb1e\libtfmicro.a(fft.cc.o): In function `FftCompute':
C:\Users\Huy\Documents\PlatformIO\Projects\micro_speech/lib\tfmicro\tensorflow\lite\experimental\microfrontend\lib/fft.cc:43: undefined reference to `kiss_fftr'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\nodemcu-32s\firmware.elf] Error 1

I don’t khow how to fix, please help me

This is not on PlatformIO Registry. How can we reproduce your error?

Hello maxgerhardt, I follow this tutorial with tensorflow github repo v2.4.0. I generate using command make -f tensorflow/lite/micro/tools/make/Makefile TARGET=esp32 generate _micro_speech_make_project then I copy all the folder as the turorial said. After I fixed some include path, I get to this error when build the project

The missing files are in the third-party kissfft directory, a Bazel script builds that.

I’d recommend to try grabbing the same files from https://github.com/tensorflow/tensorflow/blob/8fa1dfaa388d3c07c2c325653aa26460e77344c1/third_party/kissfft/workspace.bzl and adding them into the library.

Don’t forget to add this macro to the build_flags, just like Bazel would.

Hi, I found out the missing file are .c file. After added like you told me, I build successfully. Thanks you for your help