-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESP32 compile error with arduino-esp32 v2.0.3-rc1 (error: fatal error: bits/error_constants.h: No such file or directory) #6593
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
Can not reproduce
|
#Compile error occurs when using ESP32_BLE_Arduino library #include "BLEDevice.h" void setup() { } void loop() { } |
@jmvandervalk maybe something went wrong during the installation of the core/toolchain. Your sketch compiles fine for all chips here |
Can I consider this as solved or you still need help? |
After checking that 2.0.3 was released, I updated it and recompiled it.
|
I have a similar error on a system running under Win10. An identical system running Win11 works - the file bits/error_constants.h appears to exist. I am wondering if the composite file name is too long during the compilation process. |
is this still valid? |
That's right. |
Nothing has changed here. I have two machines. V2.0.3 does not work on one machine. V2.0.2 works fine on both. On the machine where V2.0.3 does nor work the error message from V2.0.3 is as above. The file does actually exist, but is not being found. |
Thanks for updates folks. @PilnyTomas PTAL |
I have sketch where I'm also using BluetoothSerial.h. On one it's working flawless... on second I'm getting mentioned errors: Even the most basic usage of BTserial do the same error. I tried to copy Arduino15/* between machines and install Arduino IDE 2.0xxx >> Same error. Can't it be related to installed version VCC redist ? |
What OS do you have on both machines - are they the same version? |
W10. They are identical. |
I have the error running under Win10, but not when running under Win11. I have been meaning to check the configuration of each to see that the max file name length is the same - but have not done this yet. (I presume that "bits/error_constants.h" does actually exisit.) |
I am also experiencing this error. I just installed the Arduino IDE v1.8.19 and the Arduino-ESP32 package, v2.0.3. I'm compiling to a ESP32-S3 and running Windows 10 v1904. I only get this error when compiling with Bluetooth stuff. Other examples seem to work fine. |
So
Ty the following solution: head to packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\bits /=========================================/ // This library is distributed in the hope that it will be useful, // Under Section 7 of GPL version 3, you are granted additional // You should have received a copy of the GNU General Public License and /** @file bits/error_constants.h
#ifndef _GLIBCXX_ERROR_CONSTANTS #include <bits/c++config.h> namespace std _GLIBCXX_VISIBILITY(default) enum class errc #ifdef _GLIBCXX_HAVE_EBADMSG
#ifdef _GLIBCXX_HAVE_EIDRM
#ifdef _GLIBCXX_HAVE_ENOLINK
#ifdef _GLIBCXX_HAVE_ENODATA
#ifdef _GLIBCXX_HAVE_ENOSR
#ifdef _GLIBCXX_HAVE_ENOSTR
#ifdef _GLIBCXX_HAVE_ENOTSUP #ifdef _GLIBCXX_HAVE_ECANCELED
#ifdef _GLIBCXX_HAVE_EOWNERDEAD
#ifdef _GLIBCXX_HAVE_EPROTO
#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE #ifdef _GLIBCXX_HAVE_ETIME #ifdef _GLIBCXX_HAVE_ETXTBSY
#ifdef _GLIBCXX_HAVE_EOVERFLOW
_GLIBCXX_END_NAMESPACE_VERSION #endif Save and run the program again. Hope this does help someone! cheers! |
@Benedict-Bsl Thanks!, This actually worked for me. I had to put the files in \esp32\tools\xtensa-esp32s3-elf-gcc... instead and I also had to move messages_members.h. Then it worked after that. I had both error_constants.h and messages_members.h in several other folders under esp32/tools/..., so I just copy/pasted. I also tried installing fresh copy of Arduino and Arduino-ESP32 on my laptop (Win10 Home), and I could compiled and upload the bluetooth stuff to my ESP32s3 no problems there. Those 2 files aren't in this folder on that computer. Either way, it is working on both machines now for me. |
Brilliant, many thanks. This appears to have fixed the issue. I can now compile with V2.0.3 on the Win 10 machine. I have yet to test the resulting binary - but it looks good. |
Hi, I tried compiling under both Linux (Fedora 34) and Window$ (10) using Arduino-ESP32 version 2.0.3 and I could not reproduce any issue - compiled on the first run without error. |
Anyone able to share a sketch which can help us reproduce this issue? Thanks! |
"Any" script wil cause error after including <Bluetooth..> lib.
…On Mon, Jun 27, 2022, 1:55 PM Vojtěch Bartoška ***@***.***> wrote:
Anyone able to share a sketch which can help us reproduce this issue?
Thanks!
—
Reply to this email directly, view it on GitHub
<#6593 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASLBZE5YDLKTBXPN6QMECMLVRGJBTANCNFSM5T25ZSFA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@Gouzi001 Can not reproduce. See #6593 (comment) |
@Gouzi001 As we pointed out we cannot reproduce the issue. We need more information about your setup. Most likely something went wrong during the installation of the Arduino-esp32. |
I too experience this problem. Adding either of these two includes will generate the exact error above: I'm on 1.8.19. Windows 10. I added BLEScan to an empty sketch, and it failed to compile. |
BTW - I added the file as suggested above and immediately got the bits/messages_members.h error mentioned above. I don't have another install to take that from. I tried copying from the arduino tree, but it didn't work and failed with a completely different problem. Tried an empty file and got the exact same result. Probably something in the esp32 file that's needed. Sketch and error below: Sketch: void setup() { } void loop() { } Error: In file included from C:\Users\john_4bbk5we\OneDrive\Desktop\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.3\libraries\BLE\src/BLEScan.h:16, C:\Users\john_4bbk5we\OneDrive\Desktop\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.3\libraries\BLE\src/BLEAdvertisedDevice.h:99:2: |
Hi, @samaco634 can you locate the file... ? |
Can you, please also try the portable version of IDE? |
I think the problem has to do with the length of the file path. Comparing 2.0.2 and 2.0.4 version 2.0.4 version 2.0.2 |
So I tried that on Windoze and I'm getting that |
@tenchirocom can you please try the change in #6990 if that solves the |
@samaco634 I would like to ask you to try something: |
Any updates on this? If not, we will close this issue soon as we are not able to reproduce it. Thanks for understanding. |
I've had this error many times in the past - always after upgrading ESP32 Arduino lib. The solution for me each time is to reduce the path length to the sketch folder. I use portable Arduino IDE for all projects. If any of your library folders have the suffix '-master' then truncate this as it eats path characters. |
I had the same problem as described at the start of the issue, but I think I narrow down the problem. I'm currently using Arduino IDE 1.8.18. with ESP32 Arduino Core v2.0.5 from the stable release. If I try to compile SerialToSerialBT example (from ESP32 Examples, Examples->BluetoothSerial), it fails showing error that bits/messages_members.h file is missing (on other PC is bits/error_constants.h). But if I try to compile the same example for ESP32 Dev Module Board, it compiles successfully. Here's the catch. If I try to compile SerialToSerialBT example for ESP32 Wrover Board, but I remove -mfix-esp32-psram-cache-issue flag from boards.txt file I even try to use PSRAM in the example and again it works without the problems. So it's definitely a problem with that flag. |
Based on @Benedict-Bsl 's clue: Despite the long time, now, compile in 2.2.1 IDE. |
I tried hard to get BluetoothSerial working. I followed Benedic-bsl advice creation a error_constant.h as described. It did not solve the problem. I made the move suggested by fjmsouza. Not successful. I added the messages_members.h file in the same folder. It's worse ! I use a Nano ESP32 and IDE 2.1.1 Too bad BluetoothSerial would be very convenient for my project. I go find another way :( Unless anyone can help. With thanks |
Board
ESP32 CAM
Device Description
ESP32 Wrover Module
Hardware Configuration
No thing
Version
other
IDE Name
Arduino IDE
Operating System
Windows 10
Flash frequency
80
PSRAM enabled
yes
Upload speed
921600
Description
When I try to compile by adding "BluetoothSerial.h", an error occurs and it does not compile.
This only appears when the board option is 'ESP32 wrover module'.
Also, there is no problem in version 2.0.2.
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: