Use Of #ifdef Not Processed Consistently · Issue #6475 - GitHub
Maybe your like
- Notifications You must be signed in to change notification settings
- Fork 13.3k
- Star 16.5k
- Code
- Issues 323
- Pull requests 75
- Discussions
- Actions
- Projects 0
- Wiki
- Security
Uh oh!
There was an error while loading. Please reload this page.
- Insights
Description
I am not really sure if this is something I am lacking in my knowledge of how Arduino does things with generating the .ino.cpp file, or maybe it is a bug. Either way I am having build issues which look like #ifdef statements are not processed like they should (or at least as how I think they should be processed)
For example, in the main project.ino file, I had a forward declaration of a function and a function wrapped in an #ifdef like this:
#ifdef USES_BLYNK // Blynk_get prototype boolean Blynk_get(const String& command, byte controllerIndex,float *data = NULL ); int firstEnabledBlynkController() { return -1; } #endifThis does result in the generated file project.ino.cpp which has the whole list of function forwarde declarations:
void bla1(); #ifdef USES_BLYNK boolean Blynk_get(const String& command, byte controllerIndex,float *data = NULL ); void otherbla(); void otherbla2(); ....It does not include the #endif in the forward declarations. And thus the build does fail with lots and lots of errors since all other forward declarations are not found for obvious reasons.
If I move this part to a .h file, it all seems to work just fine.
Not sure if it has anything to do with it, but this define is not defined at the call of the compile, but is set dynamically based on other defines in one of the first included .h files.
Metadata
Metadata
Assignees
No one assignedLabels
No labelsNo labelsType
No typeProjects
No projectsMilestone
No milestoneRelationships
None yetDevelopment
No branches or pull requestsIssue actions
You can’t perform that action at this time.Tag » Arduino #ifndef Esp8266
-
Universal Upload Using #ifdef - Everything ESP8266
-
Compile On Both ESP32 And ESP8266 - PlatformIO Community
-
How To Have Compiler Know Whether Arduino Or ESP8266?
-
Ifdef Without Define - Code Example I Don't Understand - Arduino Forum
-
Arduino Preprocessor Directives Tutorial - Ifdef & Endif - Device Plus
-
Esp8266-Arduino/_ansi.h At Master - GitHub
-
How To Programatically Identify Which Microcontroller Is Connected To ...
-
Esp8266/Arduino - If Defined(SAM3X8E) - Gitter
-
This Arduino Library Doesn't Work On ESP. How Do I Make It Working?
-
Arduino-libosip2 - An Arduino ESP8266 Port Of The GNU OSIP Library
-
Esp8266/libraries/ESP8266WiFi/src/lwip/mem.h Source File
-
Remove Arduino ESP8266 Core Support Before 2.7.1
-
Arduino Error Compiling With ESP8266 - Element14 Community
-
[PDF] ESP8266 Technical Reference - Espressif Systems