-
-
Notifications
You must be signed in to change notification settings - Fork 7k
explicit inclusion of <Arduino.h> triggers compilation error #11488
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
This is correct, though I think it omits this if it is already found in the sketch. Can you provide a minimal example that triggers the problem, and provide full verbose compilation output of that? |
Yes, here is a minimal example of the problem, and thank you very much for taking a look at this puzzling problem.
Here is the message I get:
And the full verbose compilation output is as follows:
|
It looks like you put your test before the I think this is working as expected, so I'm closing this issue. If you feel otherwise, feel free to leave additional comments. |
Thank you very much for solving this puzzle, and you are absolutely right: if I put the core version test after the |
Hello,
I did check the open and closed issues and the closest I have found is this: #4352
but it's not the same.
I am using Ubuntu 20.10, Arduino 1.8.13 and STM32 core 2.0.0.
In some of my sketches I test for the STM32 core version with this code
#if !defined(STM32_CORE_VERSION) || (STM32_CORE_VERSION < 0x02000000)
#error "Due to API change, this sketch is compatible with STM32_CORE_VERSION >= 0x02000000"
#endif
This compiles totally fine.
However, if in my sketch I explicitly add:
#include <Arduino.h>
this triggers the compilation error in the test.
It was my understanding that the Arduino build system automatically adds the
#include <Arduino.h>
to the top of the generated cpp code, so that would be a double inclusion and shouldn't change anything at all, but it seems it does.Some help to solve this conundrum would be very much appreciated.
Note that the example sketches in the U8g2/u8x8 library all explicitly add
#include <Arduino.h>
, that's how I stumbled upon this problem.The text was updated successfully, but these errors were encountered: