This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

-D compiler argument with a value

I thought that the correct way to make a define with a value was to write:
MY_HEADDER=my_file.h, in the Define: textbox in "Options for Target", but its not working.
then I tried to use:
-DMY_HEADDER="my_file.h" in the "Misc Controls" textbox, but its not working also.

is it posible?

Parents
  • I would agree with Hans-Bernhard.

    A better approach might be:

    #if defined OPTION_A
    #include "header_a.h"
    #elif defined OPTION_B
    #include "header_b.h"
    #else
    #error Must define an Option!
    #endif
    


    Note the final #error clause to prevent "undefined" operation if no option (or no recognised option) is specified...

Reply
  • I would agree with Hans-Bernhard.

    A better approach might be:

    #if defined OPTION_A
    #include "header_a.h"
    #elif defined OPTION_B
    #include "header_b.h"
    #else
    #error Must define an Option!
    #endif
    


    Note the final #error clause to prevent "undefined" operation if no option (or no recognised option) is specified...

Children
No data