omniidl [options] -b<back-end> [back-end options] <file 1> <file 2> ...
-bback-end | Run the specified back-end. For the C++ ORB, use -bcxx. |
-Dname[=value] | Define name for the preprocessor. |
-Uname | Undefine name for the preprocessor. |
-Idir | Include dir in the preprocessor search path. |
-E | Only run the preprocessor, sending its output to stdout. |
-Ycmd | Use cmd as the preprocessor, rather than the normal C preprocessor. |
-N | Do not run the preprocessor. |
-T | Use a temporary file, not a pipe, for preprocessor output. |
-Wparg[,arg...] | Send arguments to the preprocessor. |
-Wbarg[,arg...] | Send arguments to the back-end. |
-nf | Do not warn about unresolved forward declarations. |
-k | Keep comments after declarations, to be used by some back-ends. |
-K | Keep comments before declarations, to be used by some back-ends. |
-Cdir | Change directory to dir before writing output files. |
-d | Dump the parsed IDL then exit, without running a back-end. |
-pdir | Use dir as a path to find omniidl back-ends. |
-V | Print version information then exit. |
-u | Print usage information. |
-v | Verbose: trace compilation stages. |
interface I; interface J { attribute I the_I; };then omniidl will normally issue a warning:
test.idl:1: Warning: Forward declared interface `I' was never fully definedIt is illegal to declare such IDL in isolation, but it is valid to define interface I in a separate file. If you have a lot of IDL with this sort of construct, you will drown under the warning messages. Use the -nf option to suppress them.
interface I { void op1(); // A comment void op2(); };the -k flag will attach the comment to op1(); the -K flag will attach it to op2().
-Wbh=suffix | Use suffix for generated header files. Default `.hh'. |
-Wbs=suffix | Use suffix for generated stub files. Default `SK.cc.' |
-Wbd=suffix | Use suffix for generated dynamic files. Default `DynSK.cc.' |
-Wba | Generate stubs for TypeCode and Any. |
-Wbinline | Output stubs for #included IDL files in line with the main file. |
-Wbtp | Generate `tie' implementation skeletons. |
-Wbtf | Generate flattened `tie' implementation skeletons. |
-Wbsplice-modules | Splice together multiply-opened modules into one. |
-Wbexample | Generate example implementation code. |
-WbF | Generate code fragments (for experts only). |
-WbBOA | Generate BOA compatible skeletons. |
-Wbold | Generate old CORBA 2.1 signatures for skeletons. |
-Wbold_prefix | Map C++ reserved words with prefix `_' rather than `_cxx_'. |
-Wbkeep_inc_path | Preserve IDL `#include' paths in generated `#include' directives. |
-Wbuse_quotes | Use quotes in `#include' directives (e.g. "foo" rather than <foo>.) |
omniidl -bcxx -Wba -Wbd=SK.cc a.idl
module M1 { interface I {}; }; module M2 { interface J { attribute M1::I ok; }; }; module M1 { interface K { attribute I still_ok; }; };but not if there are cross-module dependencies:
module M1 { interface I {}; }; module M2 { interface J { attribute M1::I ok; }; }; module M1 { interface K { attribute M2::J oh_dear; }; };In both of these cases, the -Wbsplice-modules option causes omniidl to put all of the definitions for module M1 into a single C++ class. For the first case, this will work fine. For the second case, class M1::K will contain a reference to M2::J, which has not yet been defined; the C++ compiler will complain.
omniidl -bcxx a.idlGenerate with Any support:
omniidl -bcxx -Wba a.idlAs above, but also generate Python stubs (assuming omniORBpy is installed):
omniidl -bcxx -Wba -bpython a.idlJust check the IDL files for validity, generating no output:
omniidl a.idl b.idl