"undefined reference" errors when compiling using arduino ide

Arduino:1.8.19 (Windows 10), 开发板:"Arduino Nano 33 BLE"





















sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::ei_matrix::~ei_matrix()':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy_types.h:129: undefined reference to `ei_free(void*)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `microphone_audio_signal_get_data(unsigned int, unsigned int, float*)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:1887: undefined reference to `arm_q15_to_float'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `(anonymous namespace)::ei_aligned_free(void*)':

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_aligned_malloc.h:107: undefined reference to `ei_free(void*)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `(anonymous namespace)::ei_aligned_calloc(unsigned int, unsigned int)':

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_aligned_malloc.h:69: undefined reference to `ei_calloc(unsigned int, unsigned int)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::numpy::scale(ei::ei_matrix*, float) [clone .part.6]':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:673: undefined reference to `arm_mat_scale_f32'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::ei_matrix::ei_matrix(unsigned long, unsigned long, float*)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy_types.h:104: undefined reference to `ei_calloc(unsigned int, unsigned int)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::numpy::dct2(ei::ei_matrix*, ei::DCT_NORMALIZATION_MODE)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:498: undefined reference to `ei::dct::transform(float*, unsigned int)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::numpy::normalize(ei::ei_matrix*)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:1112: undefined reference to `arm_min_f32'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:1148: undefined reference to `arm_max_f32'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::numpy::software_rfft(float*, float*, unsigned int, unsigned int)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2166: undefined reference to `ei_malloc(unsigned int)'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2174: undefined reference to `kiss_fftr_alloc'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2176: undefined reference to `ei_free(void*)'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2183: undefined reference to `kiss_fftr'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2190: undefined reference to `ei_free(void*)'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2191: undefined reference to `ei_free(void*)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::numpy::std_axis0_CMSIS(ei::ei_matrix*, ei::ei_matrix*)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2326: undefined reference to `ei_calloc(unsigned int, unsigned int)'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2332: undefined reference to `arm_mat_trans_f32'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2348: undefined reference to `ei_free(void*)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::numpy::cmsis_rfft_init_f32(arm_rfft_fast_instance_f32*, unsigned int)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2638: undefined reference to `arm_cfft_sR_f32_len16'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2638: undefined reference to `twiddleCoef_rfft_32'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2638: undefined reference to `arm_cfft_sR_f32_len128'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:2638: undefined reference to `twiddleCoef_rfft_256'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::numpy::rfft(float const*, unsigned int, float*, unsigned int, unsigned int)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:1408: undefined reference to `arm_rfft_fast_f32'

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:1416: undefined reference to `arm_rms_f32'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::speechpy::processing::preemphasis::~preemphasis()':

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/processing.hpp:144: undefined reference to `ei_free(void*)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/processing.hpp:147: undefined reference to `ei_free(void*)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::speechpy::feature::filterbanks(ei::ei_matrix*, unsigned short, int, unsigned long, unsigned long, unsigned long, bool)':

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:68: undefined reference to `ei_malloc(unsigned int)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:95: undefined reference to `ei_malloc(unsigned int)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:124: undefined reference to `ei_free(void*)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:117: undefined reference to `ei_free(void*)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:122: undefined reference to `ei_malloc(unsigned int)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:130: undefined reference to `ei_free(void*)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/feature.hpp:167: undefined reference to `ei_free(void*)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::speechpy::processing::preemphasis::preemphasis(ei::ei_signal_t*, int, float, bool)':

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/processing.hpp:57: undefined reference to `ei_calloc(unsigned int, unsigned int)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/dsp/speechpy/processing.hpp:58: undefined reference to `ei_calloc(unsigned int, unsigned int)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `ei::speechpy::feature::mfe(ei::ei_matrix*, ei::ei_matrix*, ei::ei_signal_t*, unsigned long, float, float, unsigned short, unsigned short, unsigned long, unsigned long, unsigned short)':

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy.hpp:275: undefined reference to `arm_mat_mult_f32'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `run_inference':

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:831: undefined reference to `ei_read_timer_us()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:612: undefined reference to `trained_model_init(void* (*)(unsigned int, unsigned int))'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:634: undefined reference to `ei_read_timer_us()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:674: undefined reference to `trained_model_input(int)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:675: undefined reference to `trained_model_output(int)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:751: undefined reference to `trained_model_invoke()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:764: undefined reference to `ei_read_timer_us()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:562: undefined reference to `ei_printf_float(float)'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:798: undefined reference to `trained_model_reset(void (*)(void*))'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:801: undefined reference to `ei_run_impulse_check_canceled()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:897: undefined reference to `ei_read_timer_us()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:1139: undefined reference to `ei_run_impulse_check_canceled()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:579: undefined reference to `ei_printf_float(float)'

sketch\nano_ble33_sense_microphone.ino.cpp.o: In function `run_classifier':

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:1182: undefined reference to `ei_read_timer_us()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:1212: undefined reference to `ei_run_impulse_check_canceled()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:1219: undefined reference to `ei_read_timer_us()'

C:\Users\19325\Documents\Arduino\libraries\src/edge-impulse-sdk/classifier/ei_run_classifier.h:1225: undefined reference to `ei_printf_float(float)'

collect2.exe: error: ld returned 1 exit status

exit status 1

为开发板 Arduino Nano 33 BLE 编译时出错。



在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。

when i compiling the example using arduino ide, many ‘undefined reference’ errors happened. is there anyone who know how to solve this? thx!

Hello @Beryllium,

Can I make sure you’ve:

  • Imported the generated library correctly (download your library from the Deployment page, import the .zip into your Arduino IDE from Sketch->Import Library-> Add .ZIP Library and then open the example from File->Example->nano_ble33_sense_microphone)
  • You have installed the right board from the Tools->Board->Board Manager (v2.9.9)
  • You have selected the right board from Tools->Board->Arduino Mbed OS Nano Boards->Arduino Nano 33 BLE

Let me know if these steps are ok, I’ll dig deeper if you still have an issue.

Best,

Louis


Am facing the same issue as well @louis. I’ve downloaded the code from github .Link: https://github.com/Manivannan-maker/ECGAnalyzer. Could you give any suggestions.

@Mani, any idea how to fix @Ajayraj10 issue?

@Ajayraj10, did you get the v2.9.9 Arduino Mbed OS Nano boards like here: https://docs.edgeimpulse.com/docs/deployment/running-your-impulse-arduino ?

Regards,

Louis

yes @louis i have used Arduino Nano 33 BLE sense board

Hello @Ajayraj10,

Can you tell me which version of the board do you have in the Arduino IDE board manager please?

Regards,

Louis

Arduino mbed os nano boards version 3.2.0

Hello @Ajayraj10, can you install the version 2.9.9 please?

Let me know if that fixes your issue.

Best,

Louis

There is no such version named 2.9.9 on mbed os nano boards

Hello @Ajayraj10 ,

can you try the 2.6.1 then? It’s the one I have on my laptop.

Regards,

Louis

The error is still there @louis

Your Edge Impulse library is imported incorrectly.

Your screen shot shows:

c:\users\19325\documents\arduino\libraries\src\edge-impulse-sdk\dsp/numpy_types.h:129: undefined reference to ei_free(void*)’`

This indicates your library is called: src

Your library folder should be more like:
c:\users\19325\documents\arduino\libraries\<YOUR_EI_LIBRARY_NAME>

Then the path to numpy_types.h will be:
c:\users\19325\documents\arduino\libraries\<YOUR_EI_LIBRARY_NAME>\src\edge-impulse-sdk\dsp\numpy_types.h

2 Likes