[omniORB] packaging stubs in a dll

Renzo Tomaselli renzo.tomaselli@tecnotp.it
Mon, 3 Dec 2001 16:53:32 +0100


Hi all,
    after including stubs directly into client/server code for years, we
decided to package them into separate dll/shlib for economy reasons and to
avoid the multiple proxyObjectFactory issue I mentioned in a previous
message.
Environment is OmniORB 3.04, NT/W2k, MSVC 6.0.
OmniORB sources say to define the symbol "USE_stub_in_nt_dll" on client side
before including IDL-generated include (.hh) files. This symbol forces
import declaration of external symbols.
This doesn't work when a module includes another one, and compilation fails.
Indeed if we have module Foo including module Bar, stubs of Foo packaged
into a dll behave as clients vs. Bar.
Unfortunately the generated Foo.hh does not allow to have the above symbol
undefined for Foo and defined for Bar.
The final result is, according to definition of this symbol:
- if defined in any case when compiling Foo stubs into a dll, the compiler
complains about having declared some static members Foo as imported while
they are actually defined locally;
- if never defined, we get runtime access violations because it seems that
some symbols (of static data, such as repoIDs) are left uninitialized if
imported (while the linker seems to be happy anyway).
Furthermore, if imported symbols are not declared as such, an extra
indirection call occurs for all imported functions, according to MSDN.
I think we need another symbol which should flag a specific IDL compiler
output as either client or implementation side, to avoid import/export
mismatch. And such a symbol should not propagate down along any import
chain.
Any comment ? Thanks,
                                             Renzo Tomaselli
---------------------------------------------------------------------------
TecnoTP s.n.c. Special Information System Design
Maso Pelauchi I38050 Ronchi Valsugana,  Trento TN  ITALY
Tel. +39 0461 773164      Fax. +39 0461 771514
e-mail: renzo.tomaselli@tecnotp.it
---------------------------------------------------------------------------