Не могу скомпилировать проект для ESP-IDF
Сообществу привет!
Есть проект sip клиента для домофона для esp32 на github. Я его скачал, но не могу скомпилировать. Среда esp-idf
установлена и работает нормально. Работаю из под Windows 10. На команду idf.py build
, выполненную из папки проекта, получаю ошибку:
undefined reference to `app_main'
Поиск в интернете привёл меня к тому, что в структуре проекта в папке main
должен быть файл CMakeLists.txt
. Я его создаю на основе примеров из esp-idf\examples\
с содержанием idf_component_register(SRCS "main.cpp" INCLUDE_DIRS ".")
. После чего пытаюсь скомпилировать проект. Появляется уже другая ошибка:
UnicodeEncodeError: 'charmap' codec can't encode character '\xfc' in position 36: character maps to <undefined>
Задать автору вопрос на гитхабе не могу, т.к. он убрал возможность добавления запросов. Подскажите, как скомпилировать проект? Ниже приведу подробные коды ошибок.
Ошибка после компиляции оригинального проекта:
D:\Projects\sip-call-master>idf.py build
Executing action: all (aliases: build)
Running ninja in directory D:\Projects\sip-call-master\build
Executing "ninja all"...
[1/1] cmd.exe /C "cd /D D:\Projects\sip-call-master\b.../Projects/sip-call-master/build/bootloader/bootloader.bin"
Bootloader binary size 0x6860 bytes. 0x7a0 bytes (7%) free.
[2/4] Linking CXX executable sip-client.elf
FAILED: sip-client.elf
cmd.exe /C "cd . && C:\Users\User\.espressif\tools\xtensa-esp-elf\esp-13.2.0_20230928\xtensa-esp-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address -Wl,--cref -Wl,--defsym=IDF_TARGET_ESP32=0 -Wl,--Map=D:/Temp/Projects/sip-call-master/build/sip-client.map -Wl,--no-warn-rwx-segments -fno-rtti -fno-lto -Wl,--gc-sections -Wl,--warn-common -T esp32.peripherals.ld -T esp32.rom.ld -T esp32.rom.api.ld -T esp32.rom.libgcc.ld -T esp32.rom.newlib-data.ld -T esp32.rom.syscalls.ld -T esp32.rom.newlib-funcs.ld -T memory.ld -T sections.ld @CMakeFiles\sip-client.elf.rsp -o sip-client.elf && cd ."
C:/Users/User/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: esp-idf/freertos/libfreertos.a(app_startup.c.obj):(.literal.main_task+0x24): undefined reference to `app_main'
C:/Users/User/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: esp-idf/freertos/libfreertos.a(app_startup.c.obj): in function `main_task':
C:/Users/User/esp/esp-idf/components/freertos/app_startup.c:199:(.text.main_task+0x99): undefined reference to `app_main'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the D:\Projects\sip-call-master\build\log\idf_py_stderr_output_12564 and D:\Projects\sip-call-master\build\log\idf_py_stdout_output_12564
Ошибка после добавления файла CMakeLists.txt
:
Executing action: all (aliases: build)
Running cmake in directory D:\Temp\Projects\sip-call-master\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 '-DPYTHON=C:\Program Files\Python39\Scripts\python.exe' -DESP_PLATFORM=1 -DCCACHE_ENABLE=1 D:\Temp\Projects\sip-call-master"...
-- IDF_TARGET is not set, guessed 'esp32' from sdkconfig 'D:/Projects/sip-call-master/sdkconfig'
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.39.1.windows.1")
-- Component directory D:/Projects/sip-call-master/components/audio_client does not contain a CMakeLists.txt file. No component will be added
-- Component directory D:/Projects/sip-call-master/components/display does not contain a CMakeLists.txt file. No component will be added
-- Component directory D:/Projects/sip-call-master/components/sip_client does not contain a CMakeLists.txt file. No component will be added
-- ccache will be used for faster recompilation
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/User/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/User/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/User/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file D:/Projects/sip-call-master/sdkconfig
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Program Files\Python39\Lib\site-packages\kconfgen\__main__.py", line 16, in <module>
main()
File "C:\Program Files\Python39\Lib\site-packages\kconfgen\core.py", line 402, in main
output_function(deprecated_options, config, temp_file)
File "C:\Program Files\Python39\Lib\site-packages\kconfgen\core.py", line 566, in write_cmake
write_node(n)
File "C:\Program Files\Python39\Lib\site-packages\kconfgen\core.py", line 557, in write_node
write('set({}{} "{}")\n'.format(prefix, sym.name, val))
File "encodings\cp1251.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\xfc' in position 36: character maps to <undefined>
CMake Error at C:/Users/User/esp/esp-idf/tools/cmake/kconfig.cmake:209 (message):
Failed to run kconfgen (C:/Program
Files/Python39/Scripts/python.exe;-m;kconfgen;--list-separator=semicolon;--kconfig;C:/Users/User/esp/esp-idf/Kconfig;--sdkconfig-rename;C:/Users/User/esp/esp-idf/sdkconfig.rename;--config;D:/Projects/sip-call-master/sdkconfig;--env-file;D:/Projects/sip-call-master/build/config.env).
Error 1
Call Stack (most recent call first):
C:/Users/User/esp/esp-idf/tools/cmake/build.cmake:615 (__kconfig_generate_config)
C:/Users/User/esp/esp-idf/tools/cmake/project.cmake:605 (idf_build_process)
CMakeLists.txt:10 (project)