Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic cstdlib:41: fatal error bits\c++config.h No such file or directory (Read 176 times)
marek2
Newbies
*
Offline


Posts: 9
Joined: Jan 18th, 2013
cstdlib:41: fatal error bits\c++config.h No such file or directory
Jan 9th, 2025 at 7:05pm
Print Post  
Hi,

I am getting this build error

cstdlib:41: fatal error  bits\c++config.h  No such file or directory

while building a sketch with just empty setup() and loop() functions. This is happening using arduino-portable thing and Visual Micro (No IDE) option.
Here's what I do:

1. start VS2019 and create a new Arduino Empty Project (separate solution and project dirs)
2. close VS2019
3. go to my solution dir and create arduino-portable folder
4. start VS2019 and open the solution I just created
5. go to Board Manager and install esp32 2.0.17
6. click on Find or install a board... in the dropdown for the boards (as there's none)
7. install esp32 2.0.17 from the Board Manager
8. click on Rescan
9. From the boards dropdown select ESP32S3 Dev Module
10. Hit F6 to build

The difference I see in between arduino-portable and the usual arduino location is that in the arduino-portable path:

\arduino-portable\packages\esp32\tools\xtensa-esp32s3-elf-gcc\

there's only esp-2021r2-patch5-8.4.0 folder 
whereas in the normal arduino path:

\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\

there's two folders:
esp-2021r2-patch5-8.4.0
gcc8_4_0-esp-2021r2-patch5

Not sure if that makes any difference.

Also if I go to the folder of cstdlib file:
arduino-portable\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5- 8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\

(had to add a space after patch5- otherwise this forum engine doesn't show the path correctly)

there's truly no bits folder, one has to go to :
arduino-portable\packages\esp32\tools\xtensa-esp32se-elf-gcc\esp-2021r2-patch5- 8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\xtensa-esp32s3-elf

where the bits folder is (and c++config.h is in it)
« Last Edit: Jan 9th, 2025 at 7:15pm by marek2 »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: cstdlib:41: fatal error bits\c++config.h No such file or directory
Reply #1 - Jan 10th, 2025 at 9:21am
Print Post  
Thanks for the report.

This seems to be very similar to the final element of this thread for the Uno R4 Minima, where the path to the arduino-portable folder is too long for the compiler to use.

Testing with the ESP32S3 in the v2.0.17 board package as you have, the maximum path to the arduino-portable folder is 38 chars.

i.e. Current Path (44 Chars): d:\My Documents\Projects\Arduino\ESP32S3Test\arduino-portable

Will work if it is shortened to:
d:\My Documents\Projects\Arduino\ESP32\arduino-portable

You should be safe to close the solution, and rename the folder as above (as the VCXPROJ is still within a subfolder of the correct sketch name).

We will investigate if we can detect the root cause of this happening, so we can output a useful hint in this scenario.

  
Back to top
IP Logged
 
marek2
Newbies
*
Offline


Posts: 9
Joined: Jan 18th, 2013
Re: cstdlib:41: fatal error bits\c++config.h No such file or directory
Reply #2 - Jan 10th, 2025 at 6:52pm
Print Post  
Thank you for a quick reply. Shortening the path did help alright. Can we ever escape the path-too-long problem... Smiley
  
Back to top
 
IP Logged
 
marek2
Newbies
*
Offline


Posts: 9
Joined: Jan 18th, 2013
Re: cstdlib:41: fatal error bits\c++config.h No such file or directory
Reply #3 - Jan 12th, 2025 at 12:22pm
Print Post  
FYI, just a few more observations...I am now using this folder:

c:\Arduino\ESP32S3_4848S040_Clock3\arduino-portable

so 35 characters before arduino-portable and when I use esp32 3.0.0 I get the same error while it's building a different file:

allocator.h: 46:10: fatal error: bits\c++ No such file or directory

If I switch to 3.0.7 it builds fine.
And If I shorten the path to 

c:\Arduino\ESP32S3_4848S040\arduino-portable

it does build on esp32 3.0.0 fine too.

Also one small thing I noticed, when you uninstall esp32 it still keeps these folders:
(added a space in the path to get it rendered correctly in the forum)

c:\Arduino\ESP32S3_4848S040_Clock3\arduino-portable\packages\esp32 
c:\Arduino\ESP32S3_4848S040_Clock3\arduino-portable\packages\esp32\hardware
c:\Arduino\ESP32S3_4848S040_Clock3\arduino-portable\packages\esp32\hardware\ esp32
c:\Arduino\ESP32S3_4848S040_Clock3\arduino-portable\packages\esp32\tools

they are empty so not a biggie.

And unrelated to the above I wanted to ask...I am trying to test my project with different core and library versions. For that I create copies of the project folder so I have like

c:\Arduino\ESP32S3_4848S040_Clock1
c:\Arduino\ESP32S3_4848S040_Clock2
c:\Arduino\ESP32S3_4848S040_Clock3

and using the board manager I install a different esp32 version in each. Underneath those folders there's arduino-portable folder and the folder for the ino:

c:\Arduino\ESP32S3_4848S040_Clock1\ESP32S3_4848S040_Clock\ESP32S3_4848S040 _Clock.ino
c:\Arduino\ESP32S3_4848S040_Clock2\ESP32S3_4848S040_Clock\ESP32S3_4848S040 _Clock.ino
c:\Arduino\ESP32S3_4848S040_Clock3\ESP32S3_4848S040_Clock\ESP32S3_4848S040 _Clock.ino

the problem with that is they all build to the same temp VMBuilds

\AppData\Local\Temp\VMBuilds\ESP32S3_4848S040_Clock\esp32_esp32s3

If I understand correctly that's based on the project name and selected board which in my case is the same for all 3 copies. So if I want to test something simultaneously in Clock1, Clock2 and Clock3 projects it has to rebuild the cores as I try to sequentially build Clock1, Clock2 and then Clock3 (and ideally I'd like to do the builds simultaneously).

To get around it, I am now renaming the projects as well, so I have 

c:\Arduino\ESP32S3_4848S040_Clock1\ESP32S3_4848S040_Clock1\ESP32S3_4848S040 _Clock1.ino
c:\Arduino\ESP32S3_4848S040_Clock2\ESP32S3_4848S040_Clock2\ESP32S3_4848S040 _Clock2.ino
c:\Arduino\ESP32S3_4848S040_Clock3\ESP32S3_4848S040_Clock3\ESP32S3_4848S040 _Clock3.ino

which then creates different folders in VMBuilds. Is that the way I need to do it or is there something else I can do to keep ino files the same in all 3? 
I like the concept of arduino-portable and I am thinking that if VMBuilds folder could be made configurable per project (or have VMBuilds next to the arduino-portable folder) it would make the project and it's build fully isolated. I also understand that my use case is probably quite niche so I am fine doing the rename.

One more thing I noticed when renaming the project...If I rename let's say ESP32S3_4848S040_Clock3.ino to ESP32S3_4848S040_Clock4.ino in visual studio, it asks me to if I want to rename the folders to which I say OK and it renames it but the .filters file remains the same: ESP32S3_4848S040_Clock3.vcxproj.filters so when the project automatically reloads, all files are at the root level in solution explorer. I have to manually rename the filters file and restart VS.

Thanks for your time to read this Smiley
« Last Edit: Jan 12th, 2025 at 12:34pm by marek2 »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2564
Joined: Feb 13th, 2019
Re: cstdlib:41: fatal error bits\c++config.h No such file or directory
Reply #4 - Jan 13th, 2025 at 11:44am
Print Post  
Thanks for the detail around this.

The different versions' compilers may use different include paths internally (which is the root cause of the path length issue which we are currently investigating).

It is best for all projects to have unique names to ensure the build folders and project caches are separate.  To speed up the core build the vMicro > Compiler > Shared Cache for Cores should be enabled.

Depending on the contents of your project code, you may be able to migrate it to a separate shared project, which can then be referenced in each of your build projects, so there is only one copy of the code keeping it simpler to maintain.
Documentation: https://www.visualmicro.com/post/2016/05/27/Sharing-code-between-projects.aspx
Video: https://www.youtube.com/watch?v=01B0G1dXOBg

We will look into the issue with the filters file not being renamed as expected.
« Last Edit: Jan 13th, 2025 at 11:45am by Simon@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint