-
Notifications
You must be signed in to change notification settings - Fork 7.6k
An error occurred while compiling the Esp32 project using Arduino. Switching to a 2.0.11 \ 2.0.12 \ 2.0.14 \ 3.0.0 Alpha version library and multiple IDE versions reported an error of "\bits\allocator.h:46:10: fatal error: bits/c++allocator.h: No such file or directory" #9271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As far as I remember, this issue is caused by path to the file being too long. @SuGlider @lucasssvaz do you remember if there was any fix for Windows or reason that max path length to be different for some reason? @BalancedTernary what is the file system of the C drive? |
The file system of my c drive is NTFS. |
It makes no difference which Filesystem is used. The max. len for a cmd is 8191 bytes when using Windows. |
@Jason2866 it's not command length, but path length, which was something like 256, but was often found to be a bit less. We already had that issue with RV toolchain and 3.0.0, where we had to rename the package in order to save some bytes for longer usernames. |
I don't know if this information will be useful: I looked for the "c++allocator.h" file in the "/bits" directory, and it was indeed not found. It looks like it includes a file that doesn't exist, or is in the wrong location. |
@me-no-dev Oh, my. Didn't know the issue about Path length. CMD length is restricted as I wrote too. This "bites" in Platformio using Windows. platformio/platformio-core#4856 Microsoft Infos: https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation |
@me-no-dev I remember that this could happen if the path was too long or the extraction of the libraries failed somehow. @BalancedTernary I would recommend running the get script again to make sure everything was extracted properly. |
How long is
I've found this file in a few folders. The longest path seems to be (for Arduino Core 3.0.0-Alpha3) My suggestion would be to reinstall the Arduino environment. |
@BalancedTernary if you can not find the file anywhere in the toolchain folder, then because of that same issue, it was not even extracted. |
I tried to reacquire and install the development library, but it didn't work. |
My "UserName" has 23 English characters. I can also find this file in a similar directory, but gcc doesn't seem to find it from this directory. |
I can find these files under the toolchain folder, but they don't find the directory indicated in the error log. It actually exists in "AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\xtensa-esp32s3-elf\bits" , but gcc is found in "AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\bits" |
It really seems like the combination of a 23 characters username and the long path is preventing Windows tools from being able to open the files. The issue seems related to the number of characters from a PATH that Windows is able to deal in GCC tools. A Not perfect solution could be trying to install the Arduino under a "short user name" and check if this makes it work. |
I've found a Windows Microsoft discussion about a problem with path longer than 256 characters: Another similar from GCC: It sounds like a general problem with Windows... Not sure what we could do to help it, beyond what has been done in #8750 |
A possible solution is depicted in https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry |
The currently only real solution is not to use Windows. Using a VM running Ubuntu and everything just works. To be clear this is a big bug in Windows, nowhere else!! |
I tried to use a short username, but the same error still occurred. I tried to copy all the files in "AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\xtensa-esp32s3-elf\bits" to "AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\bits", and now the problem is temporarily solved. |
@BalancedTernary - Can you please check this Windows registry: It should be set as 1 (true). When it is '0', Windows will limit the path to 260 chars. Go to the command search text box at the TaskBar, run "regedit.exe" and browse the Registry directory up to |
Hello @BalancedTernary, can this ticket be closed as answered? |
Hello, Due to the overwhelming volume of issues currently being addressed, we have decided to close the previously received tickets. If you still require assistance or if the issue persists, please don't hesitate to reopen the ticket. Thanks. |
Board
ESP32S3 Dev Module
Device Description
ESP32S3 Dev Module
Hardware Configuration
not anything
Version
v2.0.14
IDE Name
Arduino(Multiple versions, including the latest version)
Operating System
Windows10
Flash frequency
80MHz
PSRAM enabled
yes
Upload speed
921600
Description
Any development board that involves ESP32 will compile incorrectly, while a development board that does not involve ESP32 can be successfully compiled
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: