`ArduinoBearSSLConfig.h` in sketch folders not accessible to library
IraSch opened this issue · 4 comments
I installed the BearSSL library latest version. I put the ArduinoBearSSLConfig.h file in the same directory as my sketch, and modified it to uncomment the line:
#define ARDUINO_DISABLE_ECCX08In my sketch I have
#include "ArduinoBearSSLConfig.h"
#include <ArduinoBearSSL.h>But I get a compile error:
Error compiling for board Arduino/Genuino MKR1000
I also tried adding the #define at the top of my sketch, but still get the compile error.
I thought I saw someone else using this library with MKR1000, so I must be missing something.
Hi @IraSch. I'm going to ask you to post the full output from a compilation. Please do this:
- Open the sketch that uses the ArduinoBearSSL library in Arduino IDE.
- Select Tools > Board > Arduino SAMD Boards (32-bits ARM Cortex-M0+) > Arduino MKR 1000 WiFi from the Arduino IDE menus.
- Select Sketch > Verify/Compile from the Arduino IDE menus.
- Wait for the compilation to fail.
- You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
- Paste the error messages in a comment here on the GitHub thread.
In order to ensure the text is not corrupted, please use code fencing. - Click the "Comment" button to post the output.
I am able to get my sketch to compile now. What I did was to put ArdruinoBearSSLConfig.h (with the DEFINE uncommented) in with the other Bear library files instead of having it in the same folder as my sketch.
Thank you for your help and for your library
I suspected this was the problem. Unfortunately #45 was not tested. The system of putting the ArduinoBearSSLConfig.h in the sketch folder as demonstrated in the library examples is fatally flawed because, at least in the official boards platforms (the situation is different for the 3rd party "STM32 MCU based boards" platform and perhaps some other 3rd party platforms), the sketch folder is intentionally not added to the the compiler's "search path", so this conditional will always evaluate as false:
ArduinoBearSSL/src/ArduinoBearSSL.h
Line 29 in d7a68ae
and thus an ArduinoBearSSLConfig.h in the sketch folder will have no effect on the library, as was previously reported three years ago at #45 (comment), but never acted on.
In order to avoid other users suffering from the same poor experience caused by this defect, the pointless ArduinoBearSSLConfig.h files must be removed from the examples and the correct way to use the ArduinoBearSSLConfig.h system documented. We will use this issue to track that task so it must remain open even though you are no longer suffering from it.