Discussion:
[omniORB] Still trying to resolve linkerunresolved tokens issue
Perham, David A. (Mission Systems)
2007-04-13 03:35:07 UTC
Permalink
Howdy:

I posted a few days ago about a problem I am having with out parameters
of structure objects.

Given the following definitions in IDL:

enum ENTITY_TYPE_ENUM
{
PLATFORM_TYPE,
AIRCRAFT_TYPE,
BIOLOGIC_TYPE,
CLOUD_TYPE,
DECOY_TYPE,
GEOPOINT_TYPE,
UNKNOWN_TYPE
} ;

typedef struct EntitySummary
{
long EntityId ;
string<100> EntityName ;
ENTITY_TYPE_ENUM EntityType ;
short EntityXPosition ;
short EntityYPosition ;

} EntitySummaryType ;

boolean RequestEntitySummary( in long EntityId,
in ENTITY_TYPE_ENUM EntityType,
out EntitySummaryType
EntitySummary ) ;


The follwowing method is generated by the idl compiler:

virtual CORBA::Boolean RequestEntitySummary(CORBA::Long EntityId,

EntityInterface::ENTITY_TYPE_ENUM EntityType,

EntityInterface::EntitySummaryType_out EntitySummary) = 0;


In the Implementation code I have defined:

bool RequestEntitySummary( long EntityId,
EntityInterface::ENTITY_TYPE_ENUM
EntityType,

EntityInterface::EntitySummaryType_out EntitySummary )
{
...
return true ;
}


This code compiles, however I get the following link errors:

LINK : error LNK2020: unresolved token (0A0000E3)
?***@ObjectServerImpl@@
$$***@EntityInterface@@V?

$***@UEntitySummary@EntityInterface@@V?

$***@UEntitySummary@EntityInterface@@@@@@@Z
LINK : fatal error LNK1120: 1 unresolved externals


I am not seeing the problem here--any ideas?

Thanks,
Dave P
Wernke zur Borg
2007-04-13 13:10:01 UTC
Permalink
Post by Perham, David A. (Mission Systems)
virtual CORBA::Boolean RequestEntitySummary(CORBA::Long EntityId,
EntityInterface::ENTITY_TYPE_ENUM EntityType,
EntityInterface::EntitySummaryType_out EntitySummary) = 0;
bool RequestEntitySummary( long EntityId,
EntityInterface::ENTITY_TYPE_ENUM
EntityType,
EntityInterface::EntitySummaryType_out EntitySummary )
{
...
return true ;
}
After adding the interface EntityInterface {...} in the IDL I could
compile and link the example code generated with the -Wbexample flag of
the C++ backend.

The difference to your code is the namespace scope EntityInterface::
which is missing in your example. So try to define the method as
CORBA::Boolean EntityInterface::RequestEntitySummary(...).

I always use the example code as a skeleton for my implementations.

Regards, Wernke
Perham, David A. (Mission Systems)
2007-04-13 21:36:17 UTC
Permalink
It is odd that the only methods that were causing the problem were those
that had out parameters of variable length.
I wasn't aware of the -Wbexample flag--that's a great tip, thanks. I
got the stubs to link, so hopefully this problem is solved.

Thanks for the reply.

Loading...