乐鑫技术交流
直播中

1123127317

8年用户 1009经验值
擅长:制造/封装 接口/总线/驱动
私信 关注
[问答]

ESP-IDF在线工具安装之后编译example报错怎么解决?

Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Check for working C compiler: D:/ESP/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-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: D:/ESP/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe - skipped-- Detecting CXX compile features-- Detecting CXX compile features - done-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.-- Building ESP-IDF components for target esp32-- Project sdkconfig file D:/ESP/esp-idf/examples/bluetooth/bluedroid/ble/ble_ancs/sdkconfigLoading defaults file D:/ESP/esp-idf/examples/bluetooth/bluedroid/ble/ble_ancs/sdkconfig.defaults...Loading defaults file D:/ESP/esp-idf/examples/bluetooth/bluedroid/ble/ble_ancs/sdkconfig.defaults.esp32...CMake Error at ../../../../../tools/cmake/component.cmake:306 (message):  Include directory 'D:/ESP/esp-idf/components/mbedtls/mbedtls/include' is  not a directory.Call Stack (most recent call first):  ../../../../../tools/cmake/component.cmake:478 (__component_add_include_dirs)  ../../../../../components/mbedtls/CMakeLists.txt:10 (idf_component_register)-- Configuring incomplete, errors occurred!See also "D:/ESP/esp-idf/examples/bluetooth/bluedroid/ble/ble_ancs/build/CMakeFiles/CMakeOutput.log".cmake failed with exit code 1

                        

回帖(1)

刘芳

2024-6-21 16:48:14
为了解决这个问题,请按照以下步骤操作:

1. 确保您已经安装了C++编译器。ESP-IDF支持多种C++编译器,例如GCC、Clang等。您可以根据您的操作系统选择合适的编译器。

2. 检查您的环境变量。确保C++编译器的路径已经添加到系统的环境变量中。例如,在Windows系统中,您可以在“系统属性”->“高级”->“环境变量”->“系统变量”中找到“Path”变量,并确保C++编译器的路径已经添加进去。

3. 重新运行CMake。在ESP-IDF项目的根目录下,打开命令行工具,执行以下命令:

   ```
   mkdir build
   cd build
   cmake ..
   ```

   这将重新生成CMake构建系统。

4. 如果问题仍然存在,请尝试手动设置C++编译器的路径。在CMakeLists.txt文件中,找到以下行:

   ```
   set(CMAKE_C_COMPILER "D:/ESP/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe")
   ```

   在该行之后添加以下行,将路径替换为您的C++编译器路径:

   ```
   set(CMAKE_CXX_COMPILER "您的C++编译器路径")
   ```

5. 重新运行CMake,并检查是否解决了问题。


举报

更多回帖

发帖
×
20
完善资料,
赚取积分