So I wrote and published a library some time ago called BlockNot. It started out as something fairly simple and so I published it as a small single header file - no CPP file.
Then, as time went on, some changes were made to it for improving its capabilities and the last somewhat major change was to add a method to the library that, when called, affects all instantiations of the library. Specifically, one method can change a specific variable in all instantiates of the library.
Now, someone has pointed out that when they use the header file in more than one code file in a single project, it won't compile, and upon further inspection, he pointed out that this last modification to the library, POSSIBLY violates the One Definition Rule (he wasn't absolutely sure but that's what he suspected) ... I'm not an advanced C programmer by any stretch of the imagination and had never heard of this rule before, so I educated myself and from what I have learned, it seems to me that if I were to break the library up into a header file and a code file, that I could pretty much make sure that the rule is followed since that method (having a .h and a .cpp file) is somewhat there for that purpose.
I think I understand the concepts of what the header file is for and what the .cpp file is for ... where the header file declares objects and the code file defines what's in the objects - and the compiler manages the links between the two, and that the implementation of this method was created to make things more efficient for the compiler ... in a nutshell...
But after spending some hours trying to split the library up, I seem to be stumped with how to handle this method that is the one method to rule them all kinda thing ...
If I remove that addition to the library along with all of the related variables and methods that support it, then the library works fine when split into two files ... it's a very basic library as libraries go...
What I am hoping to find here is someone who understands the nature of the One Definition Rule who would be willing to take a look at the library and tell me where it's gone wrong and hopefully how to correct it.
The method in question as at the bottom and it's called resetAllTimers