I have a number of structs that I have typedef’d to store data from single instance objects like shown in the thread below. I am getting a the following error when I attempt to compile. I added #pragma SPARK_NO_PREPROCESSOR to my main.ino but not sure if I need to include that in all of my header files. I have several custom classes all using the “singleton” method and structs to track config/state data across different parts of my app. MyApp_H.h is similar to the Particle/application.h in that it is included by all custom classes and contains includes to all custom classes. I would post the code but it is getting rather large at this point and I doubt anyone would want to troll through all that so hoping it is something that is known or a silly mistake on my part.
MyApp_Time.h:14:1: warning: 'typedef' was ignored in this declaration [enabled by default]
};
^
MyApp_Time.h:22:1: warning: 'typedef' was ignored in this declaration [enabled by default]
};
^
In file included from MyApp_H.h:15:0,
from MyApp.h:4,
from MyApp.cpp:1:
So that was something else I needed to figure out, warnings won’t cause a compile failure? I do have an error right before compile termination, I think it is related to one of my typedef’d structs (undefined reference, see below). Everything else looks proper to me…but then again, it is me. Thanks for taking a look!
typedef in header file
So IF I do need the preprocessor statement in which files should it be placed? Right now it is only in main.ino (with only two blank lines above it), I couldn’t find anything that said for sure which files it belongs in.
Main.ino (self explanatory)
Pacsui_H.h (rip off the application.h header)
Class1.h/cpp
Class2.h/cpp
etc.