Export (0) Print
Expand All

/env switch

The /env switch selects the environment in which the application runs.


midl /env { win32 | ia64 | amd64 | win64 }

Switch Options

win32

Directs the MIDL compiler to generate stub files, or a type library file, for a 32-bit environment.

ia64

Directs the MIDL compiler to generate stub files, or a type library file, for a Intel Architecture 64-bit (IA64) environment.

amd64

Directs the MIDL compiler to generate stub files, or a type library file, for an Advanced Micro Devices 64-bit (AMD64) environment.

win64

Same behavior as ia64.

Remarks

The /env switch primarily affects the packing level used for structures in that environment. Be sure you specify the same packing-level setting for both the MIDL compiler and the C compiler.

The /env switch determines the packing level and other settings as follows:

  • When you specify win32, generated stubs use C-compiler packing-level 8 for all types involved in remote operations. The int data types are both 32 bits. Pointers are 32 bits.
  • When you specify ia64 or amd64, the MIDL compiler runs in a cross-compiler mode for the indicated (Intel or AMD) 64-bit platform. The generated stubs use C-compiler packing-level 8 for all types involved in remote operations. The long and int data types are 32 bits. Pointers are 64 bits.

The /align, /pack, and /Zp switches take precedence over the /env settings.

For more information on 64 bit support for MIDL and RPC see Designing 64-bit-Compatible Interfaces.

Examples

midl /env win32 filename.idl

midl /env ia64 filename.idl

midl /env amd64 filename.idl

midl /env win64 filename.idl

See also

General MIDL Command-line Syntax
/pack
/Zp

 

 

Community Additions

ADD
Show:
© 2014 Microsoft