/cpp_opt

midl /cpp_opt "C_preprocessor_option"

C_preprocessor_option
Specifies a command-line option associated with the C preprocessor. You must supply the C-compiler option /E as part of the C_preprocessor_option string.

Examples

midl /cpp_cmd "cl386" /cpp_opt "/E" filename.idl 
midl /cpp_cmd "mycpp" /DFLAG=TRUE /Ic:\tmp filename.idl 
midl /cpp_opt "/E /DFLAG=TRUE" filename.idl 
 

Remarks

The /cpp_opt switch specifies options to pass to the C preprocessor. The /cpp_opt switch can be used with or without the /cpp_cmd switch. The following table summarizes how the C-preprocessor command string is constructed for each combination of /cpp_cmd and /cpp_opt switches:

/cpp_cmd present? /cpp_opt present?
Description
Yes Yes Invokes specified C compiler with specified options. You must supply /E as part of /cpp_opt
Yes No Invokes specified C compiler with settings obtained from MIDL /I, /D, /U switches. Adds C-compiler /E switch
No Yes Invokes Microsoft C compiler with specified options. Does not use MIDL /I, /D, /U options. You must supply /E as part of /cpp_opt
No No Invokes Microsoft C compiler with /E option only

When the /cpp_cmd switch is present and the /cpp_opt switch is not, the MIDL compiler concatenates the string specified by the cpp_cmd switch with the /I, /D, and /U options and uses this concatenated string to invoke the C preprocessor for each IDL and ACF source file.

When the /cpp_cmd switch is not present, the preprocessor option is sent to the default C preprocessor. When the /cpp_cmd switch is present, the preprocessor option is sent to the specified C preprocessor.

See Also

/cpp_cmd, General MIDL Command-line Syntax, /no_cpp