Hi together,
I'm having the following problem in my project.
I want to use the “fftw3” library to calculate the spectrum at specific points in a live audio signal. When I run the code, I get the following error message:
/usr/bin/ld: /root/Bela/projects/testing/build/render.o: in function computeSpectralCentroid(std::vector<float, std::allocator<float> > const&, int)':
/root/Bela/projects/testing/render.cpp:139: undefined reference tofftwf_execute'
/usr/bin/ld: /root/Bela/projects/testing/build/render.o: in function setup':
/root/Bela/projects/testing/render.cpp:192: undefined reference tofftwf_plan_dft_r2c_1d'
/usr/bin/ld: /root/Bela/projects/testing/build/render.o: in function cleanup':
/root/Bela/projects/testing/render.cpp:361: undefined reference tofftwf_destroy_plan'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile.linkbela:46: /root/Bela/projects/testing/testing] Error 1
make: *** [Makefile:705: /root/Bela/projects/testing/testing] Error 2
I've already asked several people/AI for help, and I always end up at the point where the compiler is missing a linker. I then created a Makefile in /root/Bela/projects/testing/ and tried to set the linker to the library using “LDFLAGS += -lfftw3f”. I also tried other parameters in LDFLAGS, but the code still didn’t work. I was then told that I need to enter “make clear + make” in bela@bela.local for it to work properly. Unfortunately, I can’t access bela@bela.local because the password apparently isn’t “bela.” I’m also not allowed to reset the SD card. A handwritten fft would be to slow for me.
Does anyone else have this problem? How can I make sure the “fftw3” library is found so the code can run correctly?