编译器bug,找不到bits/c++config.h

xiagbsj
Posts: 3
Joined: Thu Nov 19, 2020 8:53 am

编译器bug,找不到bits/c++config.h

Postby xiagbsj » Thu Nov 19, 2020 9:18 am

espidf 为 v4.2 beta1,工具链也是用这个idf里的脚本装的
编译helloword,目标为esp32,报
.espressif\tools\xtensa-esp32-elf\esp-2020r2-8.2.0\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\8.2.0\bits\stl_algobase.h:59:10: fatal error: bits/c++config.h: No such file or directory #include <bits/c++config.h>错误,
把...\8.2.0\xtensa-esp32-elf\bits下的所有文件都复制到...\8.2.0\bits下解决了
但这个问题不应该存在,因为编译器有问题会导致编译任何工程一定会报错
然后clean,把目标切换为esp32s2,报同样的错误,只是路径变成了.espressif\tools\xtensa-esp32s2-elf...,但是esp32s2按照上面的方法则不行,还会报其它错误,
报.espressif\tools\xtensa-esp32s2-elf\esp-2020r2-8.2.0\xtensa-esp32s2-elf\xtensa-esp32s2-elf\include\c++\8.2.0\bits\stl_algobase.h:65:10: fatal error: bits/stl_iterator_base_types.h: No such file or directory #include <bits/stl_iterator_base_types.h>,
但是这个文件就在这个目录下

ESP_jakob
Posts: 49
Joined: Mon Jun 01, 2020 6:28 am

Re: 编译器bug,找不到bits/c++config.h

Postby ESP_jakob » Fri Nov 20, 2020 4:31 am

可以包括你编译时候的完整build-log吗?

你build的时候有遇到任何CMake warning 吗?

我在idf-v4.2-beta1上编译hello-world没有问题。

xiagbsj
Posts: 3
Joined: Thu Nov 19, 2020 8:53 am

Re: 编译器bug,找不到bits/c++config.h

Postby xiagbsj » Fri Nov 20, 2020 6:06 am

In file included from c:\users\xiagbsj\xiagbsj\other\data\softwareanddata\ordinary\embedded\esp32\.espressif\tools\xtensa-esp32s2-elf\esp-2020r2-8.2.0\xtensa-esp32s2-elf\xtensa-esp32s2-elf\include\c++\8.2.0\memory:62,
from C:/Users/xiagbsj/xiagbsj/other/data/softwareAndData/ordinary/embedded/esp32/idf/components/nvs_flash/src/nvs.hpp:18,
from C:/Users/xiagbsj/xiagbsj/other/data/softwareAndData/ordinary/embedded/esp32/idf/components/nvs_flash/src/nvs_api.cpp:14:
c:\users\xiagbsj\xiagbsj\other\data\softwareanddata\ordinary\embedded\esp32\.espressif\tools\xtensa-esp32s2-elf\esp-2020r2-8.2.0\xtensa-esp32s2-elf\xtensa-esp32s2-elf\include\c++\8.2.0\bits\stl_algobase.h:59:10: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
[318/921] Building C object esp-idf/wpa_supplicant/CMakeFiles/__idf_wpa_supplicant.dir/src/wps/wps_validate.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

编译过程没有警告

build log 指的是 build/CMakefile/CMakeOutput.log吗?
Attachments
CMakeOutput.log
(79.79 KiB) Downloaded 601 times

ESP_Alvin
Posts: 211
Joined: Thu May 17, 2018 2:26 am

Re: 编译器bug,找不到bits/c++config.h

Postby ESP_Alvin » Fri Nov 20, 2020 7:47 am

hi xiagbsj,
感谢反馈。您方便试下 `idf.py fullclean` 么? 我们不需要 CMakeOutput.log,而需要 console 的全部 logging output 来进行 debug,即在运行 `idf.py clean` 后 `idf.py build` 打印的 log。谢谢。

另外,能帮确认下工具链已成功安装么?IDF 中下载安装工具链的脚本。谢谢。

Alvin

xiagbsj
Posts: 3
Joined: Thu Nov 19, 2020 8:53 am

Re: 编译器bug,找不到bits/c++config.h

Postby xiagbsj » Fri Nov 20, 2020 8:36 am

我直接把build文件夹删掉了,所以没用fullclean
Attachments
installbat log.txt
(10.83 KiB) Downloaded 589 times
build consol.txt
(40.75 KiB) Downloaded 557 times

ESP_jakob
Posts: 49
Joined: Mon Jun 01, 2020 6:28 am

Re: 编译器bug,找不到bits/c++config.h

Postby ESP_jakob » Mon Nov 23, 2020 2:13 am

您能clean ccache吗?

Code: Select all

ccache -c
Jakob

ESP_georgik
Posts: 21
Joined: Fri Nov 06, 2020 8:23 am
Location: Brno
Contact:

Re: 编译器bug,找不到bits/c++config.h

Postby ESP_georgik » Fri Apr 16, 2021 8:51 am

The problem seems to be caused by ccache.
Please run the build without ccache to verify whether it's not the source of the problem:
  1. idf.py fullclean
  2. set IDF_CCACHE_ENABLE=
  3. idf.py build

The other issue might be too long path to .espressif: C:\Users\xiagb\xiagb\other\data\softwareAndData\ordinary\embedded\esp32\.espressif

Please make sure, that your Windows have enabled Long Paths. This can be verified by running Windows Installer. On the second screen of the installer you'll see result of the check and button 'Apply fixes' if the correction is necessary. After this screen you can cancel the installer. You can find Windows installer here: https://dl.espressif.com/dl/esp-idf/
- Juraj Michálek
Senior Embedded Software Engineer at Espressif Systems

ESP_georgik
Posts: 21
Joined: Fri Nov 06, 2020 8:23 am
Location: Brno
Contact:

Re: 编译器bug,找不到bits/c++config.h

Postby ESP_georgik » Thu May 06, 2021 4:50 pm

We confirm the issue. ESP-IDF and Tools path should be shorter than 90 characters. Longer paths are causing problems with some versions of CCache and related tools.
The problem is solved by introducing check of path length.

Please, install ESP-IDF and Tools on path that is shorter.

Solved by: https://github.com/espressif/idf-installer/pull/16
You can test installer: https://github.com/espressif/idf-instal ... .9-beta-02
- Juraj Michálek
Senior Embedded Software Engineer at Espressif Systems

Who is online

Users browsing this forum: No registered users and 149 guests