/cpp_opt switch

The /cpp_opt switch specifies options to pass to the C/C++ preprocessor.

midl /cpp_opt "C_preprocessor_option" file.idl

Switch Options


Specifies command-line option associated with the invoked preprocessor. For the Microsoft C/C++ preprocessors you must supply the /E switch as part of the C_preprocessor_option string. Quotes are required when more than one option is used, and for spaces.


Do not use this switch unless there is a specific reason for doing so. Consult C-Preprocessor Requirements for MIDL for important information regarding preprocessing.

The /cpp_opt switch can be used with or without the /cpp_cmd switch. Consult /cpp_cmd for details of how the preprocessor command line is constructed in either case.


midl /cpp_cmd d:\nt\tools\ia64\cl.exe /DFLAG=TRUE /Ic:\inc filename.idl

midl /cpp_cmd "mycpp" /DFLAG=TRUE /Ic:\inc filename.idl

midl /cpp_opt "/E /DFLAG=TRUE /Ic:\inc" filename.idl

midl /cpp_cmd "cl" /cpp_opt "/E /DFLAG=TRUE /Ic:\inc" filename.idl

See also

General MIDL Command-line Syntax
C-Preprocessor Requirements for MIDL