大家好,最近因为需要选择蓝牙音频例程a2dp_source作为基本模板做开发,但是第一步就卡住了。
在eclipse IDE中导入例程,编译的时候出错,很多undefined reference to 错误
我想说的是我编译很多其他例程都没问题,比如hello world,所以编译环境应该是没问题的。
然后例程的文件都是通过cmake进行整合的,cmake我不太懂,而且牵连很广,大致看了下也看不出问题。
我换了vscode,结果是一样的,也是这种错误。(之前是64个错误,但我idf+ide装卸很多遍+python独立安装,现在的错误是44个),
快崩溃了,大佬救命!编译结果如下:谢谢!
构建位置: D:\work\audio\ESP\micbt8\build
cmake --build . -- -v
[1/6] cmd.exe /C "cd /D D:\work\audio\ESP\micbt8\build\bootloader && D:\Espressif\tools\cmake\3.24.0\bin\cmake.exe --build ."
[1/1] cmd.exe /C "cd /D D:\work\audio\ESP\micbt8\build\bootloader\esp-idf\esptool_py && python D:/Espressif/frameworks/esp-idf-v5.0.2/components/partition_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:\Espressif\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin\riscv32-esp-elf-g++.exe -march=rv32imc -nostartfiles -march=rv32imc --specs=nosys.specs @CMakeFiles\a2dp_source.elf.rsp -o a2dp_source.elf && cd ."
FAILED: a2dp_source.elf
cmd.exe /C "cd . && D:\Espressif\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin\riscv32-esp-elf-g++.exe -march=rv32imc -nostartfiles -march=rv32imc --specs=nosys.specs @CMakeFiles\a2dp_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:\work\audio\ESP\micbt8\build
d:\Espressif\python_env\idf5.0_py3.11_env\Scripts\python.exe d:\Espressif\frameworks\esp-idf-v5.0.2\tools\idf_size.py D:/work/audio/ESP/micbt8/build/a2dp_source.map
Total sizes:
Used stat D/IRAM: 93390 bytes ( 227906 remain, 29.1% used)
Eclipse IDE+IDF- 蓝牙例程“A2DP_Source"编译错误:undefined reference to..."
-
- Posts: 2
- Joined: Sat Jul 22, 2023 2:39 am
-
- Posts: 3
- Joined: Fri Jul 14, 2023 9:26 am
Re: Eclipse IDE+IDF- 蓝牙例程“A2DP_Source"编译错误:undefined reference to..."
哈咯,
能提供例程目录下CMakeLists.txt的截图吗?
能提供例程目录下CMakeLists.txt的截图吗?
-
- Posts: 3
- Joined: Fri Jul 14, 2023 9:26 am
Re: Eclipse IDE+IDF- 蓝牙例程“A2DP_Source"编译错误:undefined reference to..."
另外编译之前可以检查下A2DP的配置项是否打开:
1) 在例程目录下终端输入: idf.py menuconfig
2) 路径: Component config->Bluetooth->Bluedroid Options->Calssic Bluetooth->A2DP
3) 将A2DP选上.
1) 在例程目录下终端输入: idf.py menuconfig
2) 路径: Component config->Bluetooth->Bluedroid Options->Calssic Bluetooth->A2DP
3) 将A2DP选上.
Who is online
Users browsing this forum: No registered users and 77 guests