Resolved "Preprocess xxxxxx.h" menu option grayed out

Discussion in 'Mac Programming' started by moonman239, Mar 28, 2016.

  1. moonman239 macrumors 68000

    Mar 27, 2009
    I'm trying to get the preprocessor output for a file, but when I go to Product->Build Action, I see that the "Preprocess xxxxxxx.h" menu option is grayed out. Could it be because it was already compiled?
  2. chown33 macrumors 604

    Aug 9, 2009
    By themselves, headers don't have build products. That is, they don't produce a .o file.

    You can only perform Preprocess on files that have build products (.m, .c, .cpp, etc.).

    If you only want a single .h file preprocess, then make a temporary .c (or .m or whatever) file that has a single line #including or #importing the header you want preprocessed.
  3. moonman239 thread starter macrumors 68000

    Mar 27, 2009
    Got it, thanks!

Share This Page