undefined reference to esp_blufi_gap_event_handler
Posted: Thu Jan 20, 2022 5:12 pm
Working on integrating blufi into our project. For some reason though, even after verifying config options between the example project and our project, I am getting a linker error when compiling. Our project is majority C++.
Seems that esp_blufi.c is somehow not being included for the compiler.
Here are the includes I'm using
And the method making the call
FAILED: controller-firmware.elf
cmd.exe /C "cd . && C:\Users\Ricky\.espressif\tools\xtensa-esp32-elf\esp-2021r2-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address @CMakeFiles\controller-firmware.elf.rsp -o controller-firmware.elf && cd ."
c:/users/ricky/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(BluetoothService.cpp.obj):(.literal._ZN16BluetoothService31esp_blufi_gap_register_callbackEv+0x0): undefined reference to `esp_blufi_gap_event_handler(esp_gap_ble_cb_event_t, esp_ble_gap_cb_param_t*)'
Seems that esp_blufi.c is somehow not being included for the compiler.
Here are the includes I'm using
Code: Select all
#include "esp_err.h"
#include "esp_blufi_api.h"
#include "esp_log.h"
#include "esp_blufi.h"
#include "esp_bt.h"
#include "esp_bt_main.h"
#include "esp_bt_device.h"
Code: Select all
esp_err_t BluetoothService::esp_blufi_gap_register_callback(void)
{
int rc;
rc = esp_ble_gap_register_callback(esp_blufi_gap_event_handler);
if(rc){
return rc;
}
return esp_blufi_profile_init();
}