Skip to content

Latest commit

 

History

History
83 lines (51 loc) · 1.92 KB

-cpp-opt.md

File metadata and controls

83 lines (51 loc) · 1.92 KB
title description ms.assetid keywords topic_type api_name api_type ms.topic ms.date
/cpp_opt switch
The /cpp\_opt switch specifies options to pass to the C/C++ preprocessor.
f0059caa-aff3-4e96-95f8-a0014d6a6556
/cpp_opt switch MIDL
apiref
/cpp_opt
NA
reference
05/31/2018

/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

C_preprocessor_option

Specifies command-line option associated with the invoked preprocessor.

Note: 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.

Remarks

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.

The /cpp_opt switch, if specified, must always include /E in order to function correctly.

Examples

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

/savePP

/cpp_cmd

General MIDL Command-line Syntax

/no_cpp

C-Preprocessor Requirements for MIDL