ESP-IDF5.0:包含EMBED_FILES的方法
错误提示:
[5/7] Linking CXX executable simple.elf
FAILED: simple.elf
cmd.exe /C “cd . && D:\vscode-espressif\tools\xtensa-esp32-elf\esp-2021r2-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address @CMakeFiles\simple.elf.rsp -o simple.elf && cd .”
d:/vscode-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(app_httpd.c.obj)😦.literal.monitor_handler+0x0): undefined reference to _binary_monitor_html_gz_end' d:/vscode-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(app_httpd.c.obj):(.literal.monitor_handler+0x4): undefined reference to
_binary_monitor_html_gz_start’
d:/vscode-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(app_httpd.c.obj)😦.literal.index_handler+0x0): undefined reference to _binary_index_ov2640_html_gz_end' d:/vscode-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(app_httpd.c.obj):(.literal.index_handler+0x4): undefined reference to
_binary_index_ov2640_html_gz_start’
d:/vscode-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(app_httpd.c.obj)😦.literal.index_handler+0x8): undefined reference to _binary_index_ov3660_html_gz_end' d:/vscode-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(app_httpd.c.obj):(.literal.index_handler+0xc): undefined reference to
_binary_index_ov3660_html_gz_start’
d:/vscode-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(app_httpd.c.obj)😦.literal.index_handler+0x10): undefined reference to _binary_index_ov5640_html_gz_end' d:/vscode-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(app_httpd.c.obj):(.literal.index_handler+0x14): undefined reference to
_binary_index_ov5640_html_gz_start’
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
修改方法:
EMBED_FILES:
修改main目录下的CMakeLists.txt
idf_component_register(SRCS “app_camera.c” “main.c” “app_wifi.c” “app_httpd.c” “app_mdns.c”
INCLUDE_DIRS “include”
#COMPONENT_REQUIRES esp32-camera esp-face nvs_flash esp_http_server fb_gfx mdns
EMBED_FILES “www/index_ov2640.html.gz” “www/index_ov3660.html.gz” “www/index_ov5640.html.gz” “www/monitor.html.gz”
)