0
I have a library that generates a result of two allowed. This is given by the definition, within the library itself, of the directives #define __SE8R01__
or #define __RF24L01P__
.
The case is that this choice should be made within the main programme. However I am not getting alternative to this, leaving the obligation to "move" in the original state of the library.
The question is how to send some directive from the main program, main()
, for any library in use. Or some alternative, so that the library when compiled recognizes the appropriate directive?
Pre-processing directives are only available at the compilation level. If you don’t have control over the library build, you won’t be able to do what you want with a simple
#define
. I speak a little more details of the C compilation process in this answer– Jefferson Quesado
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero