The meaning of Compiler pragmas are different for each compiler.
based on the errors you got I am guessing some of the pragmas generate binary code. Most binary code cannot be in headers.
Also, macros with starting underline and uppercase letters "_MCU_CONFIG_H" are not really safe to use; I think they are reserved for compiler writers.
Tim S.