PreviousNext

Description

The idl command invokes the Interface Definition Language (IDL) compiler to convert an interface definition, written in IDL, into output files. The possible output files include a header file, server stub file, client stub file, auxiliary files, and a manger class header file. The compiler constructs the names of the output files by keeping the base name of the interface definition source file, but replacing the file extension with the new extension (or suffix and extension) appropriate to the newly generated type of output file. For example, math.idl could produce math_sstub.c or math_sstub.o for the server stub.

The idl command accepts the following input:

· An interface definition file name.

· Arguments to indicate either special actions to be performed by the compiler, or special properties of the input or output files.

The IDL compiler searches through directories for any related ACF (attribute configuration file). For example, if you compile a file named source.idl, the compiler automatically searches for a file named source.acf. The compiler also searches for any imported IDL file (and its related ACF). The compiler searches for these files using the following order:

1. The current working directory. The compiler always searches this directory unless you specify the no_def_idir and -Idirectory arguments together.

2. Any imported directory. The compiler searches each directory you are specifying in the -Idirectory argument.

3. The system IDL directory. The compiler automatically imports nbase.idl, which resides in the system IDL directory. The compiler always searches this directory unless you specify the -no_def_idir argument.

4. The directory specified in the source file name. If you explicitly specify a directory in the source IDL path name, then that directory is searched for the corresponding ACF. For example, the following command causes the IDL compiler to look for /path/pathname/my_source.acf if my_source.adf is not in the directories in 1 through 3 above:

idl/path/pathname/my_source.idl

Note that this directory is not searched for any imported IDL file or its corresponding ACF.

Restrictions
The following filenames are reserved by the IDL compiler. Naming an IDL file with one of these names may result in unexpected behavior.

iovector.idl lbase.idl nbase.idl ncastat.idl
ndrold.idl rpc.idl rpcbase.idl rpcpvt.idl
rpcsts.idl rpctypes.idl twr.idl uuid.idl
Cautions
When the IDL compiler generates C code, it is ANSI C code. It also supports C compilers that are not fully ANSI compliant although a warning message may occur during compilation of the stubs by the C compiler. A C compiler that is not fully ANSI compliant may generate the following warning messages:

· warning: & before array or function: ignored

· warning: enumeration type clash, operator =

Makefiles created before OSF DCE Release 1.0.3 can produce a compiler warning if they reference .caux.o or .saux.o (auxiliary) files. You can use these Makefiles without alteration and avoid warnings by forcing IDL to generate empty aux files. In the C shell, set the IDL_GEN_AUX_FILES environment variable as follows:

setenv IDL_GEN_AUX_FILES 1

Examples

1. Invoke the IDL compiler to compile the interface definition file test.idl and keep the generated C source modules. Only server files are generated. The server stub default file name is overridden by creating a file named test_ss.c for the server stub module. The server auxiliary default file name is overridden by creating a file named test_sa.c for the server auxiliary module.

idl test.idl -keep c_source -client none -sstub test_ss.c -saux test_sa.c

2. Invoke the IDL compiler to compile the interface definition file test.idl, but do not run the C preprocessor. The manager entry point vector is not defined in the generated server stub module. The IDL compiler searches the parent directory of the current directory for any IDL files that test.idl could import. The generated output files are located in the output subdirectory under the current directory.

idl test.idl -no_cpp -no_mepv -I.. -out ./output

Errors

A representative list of errors that might be returned is not shown here. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

Files

/lib/cpp C preprocessor
dceshared/bin/idl Compiler
dceshared/include System IDL directory for imported files
dceshared/include/dce/nbase.idl Predefined IDL types
dceshared/nls/msg/LANG/idl.cat Compiler error messages
dceshared/share/include/file.ext All .idl or .h files that are part of DCE RPC
Related Information
Book:OSF DCE Application Development Guide - Core Components