FW: [omniORB] Calling omniORB shared library from a an applications shared librar on SGI

Sai-Lai Lo S.Lo@uk.research.att.com
23 Jun 2000 15:13:43 +0100


>>>>> Cameron Malley writes:

> We have pthread as the last library.
> The first symptom is that the following code always gives the failed to narrow
> message even though this works fine on other platforms.
> It also works fine if the code making this call is itself not in a shared
> library.

>     CORBA::Object_var obj = orb->string_to_object ( ior );
>     pnsprj = GLDBProjects::_narrow ( obj.in () );
>     if ( CORBA::is_nil ( pnsprj.in () ) ) {
>         fprintf ( stderr,
>                   "Failed to narrow GLDBProjects stringified reference.\n" );
 
A possible cause is that the static initialiser for a singleton 
GLDBProjects_proxyObjectFactory is never called when the code is wrapped up
in the SGI shared library, assuming that GLDBProjects is a CORBA object.

One way to verify if this is the case is to add a statement like this in
your code:

GLDBProjects_proxyObjectFactory* f = new GLDBProjects_proxyObjectFacory();

Make sure that this is called once and just after ORB_init().

If this is the cause, you have to dig through the way you build your shared
library to find out why the initialisers are not called.

Sai-Lai


-- 
Sai-Lai Lo                                   S.Lo@uk.research.att.com
AT&T Laboratories Cambridge           WWW:   http://www.uk.research.att.com 
24a Trumpington Street                Tel:   +44 1223 343000
Cambridge CB2 1QA                     Fax:   +44 1223 313542
ENGLAND