大家好,最近因为需要选择蓝牙音频例程a2dp_source作为基本模板做开发,但是第一步就卡住了。
在eclipse IDE中导入例程,编译的时候出错,很多undefined reference to 错误
我想说的是我编译很多其他例程都没问题,比如hello world,所以编译环境应该是没问题的。
然后例程的文件都是通过cmake进行整合的,cmake我不太懂,而且牵连很广,大致看了下也看不出问题。
我换了vscode,结果是一样的,也是这种错误。(之前是64个错误,但我idf+ide装卸很多遍+python独立安装,现在的错误是44个),
快崩溃了,大佬救命!编译结果如下:谢谢!
构建位置: D:workaudioESPmicbt8build
cmake --build . -- -v
[1/6] cmd.exe /C "cd /D D:workaudioESPmicbt8buildbootloader && D:Espressiftoolscmake3.24.0bincmake.exe --build ."
[1/1] cmd.exe /C "cd /D D:workaudioESPmicbt8buildbootloaderesp-idfesptool_py && python D:/Espressif/frameworks/esp-idf-v5.0.2/components/par
tition_table/check_sizes.py --offset 0x8000 bootloader 0x0 D:/work/audio/ESP/micbt8/build/bootloader/bootloader.bin"
Bootloader binary size 0x4ee0 bytes. 0x3120 bytes (38%) free.
[2/4] cmd.exe /C "cd . && D:Espressiftoolsriscv32-esp-elfesp-2022r1-11.2.0riscv32-esp-elfbinriscv32-esp-elf-g++.exe -march=rv32imc -nostartfiles -march=rv32imc --specs=nosys.specs @CMakeFilesa2dp_source.elf.rsp -o a2dp_source.elf && cd ."
FAILED: a2dp_source.elf
cmd.exe /C "cd . && D:Espressiftoolsriscv32-esp-elfesp-2022r1-11.2.0riscv32-esp-elfbinriscv32-esp-elf-g++.exe -march=rv32imc -nostartfiles -march=rv32imc --specs=nosys.specs @CMakeFilesa2dp_source.elf.rsp -o a2dp_source.elf && cd ."
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_av_volume_changed':
D:/work/audio/ESP/micbt8/main/main.c:638: undefined reference to `esp_avrc_rn_evt_bit_mask_operation'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:640: undefined reference to `esp_avrc_ct_send_register_notification_cmd'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_app_av_state_connecting_hdlr':
D:/work/audio/ESP/micbt8/main/main.c:440: undefined reference to `esp_bt_gap_set_scan_mode'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_app_av_state_disconnecting_hdlr':
D:/work/audio/ESP/micbt8/main/main.c:594: undefined reference to `esp_bt_gap_set_scan_mode'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_av_hdl_stack_evt':
D:/work/audio/ESP/micbt8/main/main.c:309: undefined reference to `esp_bt_gap_register_callback'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:309: undefined reference to `esp_avrc_ct_init'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:312: undefined reference to `esp_avrc_ct_register_callback'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:315: undefined reference to `esp_avrc_rn_evt_bit_mask_operation'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:315: undefined reference to `esp_avrc_tg_set_rn_evt_cap'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:316: undefined reference to `esp_a2d_source_init'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:319: undefined reference to `esp_a2d_register_callback'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:320: undefined reference to `esp_a2d_source_register_data_callback'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:322: undefined reference to `esp_bt_gap_set_scan_mode'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:326: undefined reference to `esp_bt_gap_start_discovery'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_app_av_state_unconnected_hdlr':
D:/work/audio/ESP/micbt8/main/main.c:411: undefined reference to `esp_a2d_source_connect'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_app_av_media_proc':
D:/work/audio/ESP/micbt8/main/main.c:530: undefined reference to `esp_a2d_media_ctrl'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:485: undefined reference to `esp_a2d_media_ctrl'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:479: undefined reference to `esp_a2d_media_ctrl'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:512: undefined reference to `esp_a2d_media_ctrl'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:526: undefined reference to `esp_a2d_source_disconnect'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_app_av_state_connected_hdlr':
D:/work/audio/ESP/micbt8/main/main.c:552: undefined reference to `esp_bt_gap_set_scan_mode'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `get_name_from_eir':
D:/work/audio/ESP/micbt8/main/main.c:140: undefined reference to `esp_bt_gap_resolve_eir_data'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:142: undefined reference to `esp_bt_gap_resolve_eir_data'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `filter_inquiry_scan_result':
D:/work/audio/ESP/micbt8/main/main.c:206: undefined reference to `esp_bt_gap_cancel_discovery'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_app_gap_cb':
D:/work/audio/ESP/micbt8/main/main.c:234: undefined reference to `esp_bt_gap_start_discovery'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:230: undefined reference to `esp_a2d_source_connect'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:257: undefined reference to `esp_bt_gap_pin_reply'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: D:/work/audio/ESP/micbt8/main/main.c:265: undefined reference to `esp_bt_gap_pin_reply'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_av_notify_evt_handler':
D:/work/audio/ESP/micbt8/main/main.c:651: undefined reference to `esp_avrc_ct_send_set_absolute_volume_cmd'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `bt_av_hdl_avrc_ct_evt':
D:/work/audio/ESP/micbt8/main/main.c:675: undefined reference to `esp_avrc_ct_send_get_rn_capabilities_cmd'
d:/espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/11.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `app_main':
D:/work/audio/ESP/micbt8/main/main.c:755: undefined reference to `esp_bt_gap_set_pin'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
构建完成(44 个错误,0 个警告): D:workaudioESPmicbt8build
d:Espressifpython_envidf5.0_py3.11_envScriptspython.exe d:Espressifframeworksesp-idf-v5.0.2toolsidf_size.py D:/work/audio/ESP/micbt8/build/a2dp_source.map
Total sizes:
Used stat D/IRAM: 93390 bytes ( 227906 remain, 29.1% used)
0