[omniORB] VC++ 6.0 & OmniORB2 - Link problems

Sai-Lai Lo S.Lo@uk.research.att.com
13 Sep 1999 22:02:47 +0100


Have you looked at the sample NMAKE file in the examples,
e.g. src/examples/echo/dir.mak?

Basically, just 2 points to remember:

1. Compiler flag:
     -D__WIN32__ -D__x86__ -D__NT__ -D__OSVERSION__=3D4
 =20
   and -I<your omniORB dir>\include
   and -O2 -MD -GX  (enable optimisation + exception handling)

2. Link libraries:

      omniORB271_rt.lib omniDynamic271_rt.lib omnithread2_rt.lib
      wsock32.lib advapi32.lib -libpath:<your omniORB dir>\lib\x86_win32

It looks like you are missing the omniDynamic271_rt.lib.
As a general rule, if you use the -a flag to omniidl2, the <stub>DynSK.cc
is generated which contains stub code to support Any. If you link this
<stub>DynSK.obj file to your executable, you need the dynamic interfaces
runtime omniDynamic271_rt.lib.

Sai-Lai



>>>>> Martin Bergek writes:

> I'm having problem linking a project. I have read the instructions in R=
EADME.win32 on which flags
> to add to the project setting but I get the following errors:

> =A0

> =A0

> BillingDataDynSK.obj : error LNK2001: unresolved external symbol "publi=
c: static class
> CORBA::TypeCode * __cdecl CORBA::TypeCode::PR_interface_tc(char const *=
,char const *)"
> (?PR_interface_tc@TypeCode@CORBA@@SAPAV12@PBD0@Z)

> BillingDataDynSK.obj : error LNK2001: unresolved external symbol "publi=
c: void __thiscall
> CORBA::Any::PR_packFrom(class CORBA::TypeCode *,void *)"
> (?PR_packFrom@Any@CORBA@@QAEXPAVTypeCode@2@PAX@Z)

> BillingDataDynSK.obj : error LNK2001: unresolved external symbol "publi=
c: bool __thiscall
> CORBA::Any::PR_unpackTo(class CORBA::TypeCode *,void *)const "
> (?PR_unpackTo@Any@CORBA@@QBE_NPAVTypeCode@2@PAX@Z)

> Release/BillingClient.exe : fatal error LNK1120: 3 unresolved externals
> Error executing link.exe.

> =A0

> =A0

> My environment:

> ---

> NT 4.0 sp5

> MS Visual C++ 6.0

> OmniORB2 2.7.1

> =A0

> =A0

> I works wonderful when compiling from the command prompt, but within th=
e visual environment it
> refuses to link. I've tried to use the same settings as in the makefile.

> =A0

> My IDL file looks like this:

> =A0

> interface Billing {
> =A0=A0=A0 void addData ();
> };

> =A0

> Really extremely simple. I'm just trying to get a workable environment.=
 I used to have the
> interface above within some module statements but tried removing them t=
o see if that's where the
> problem was.

> Any help would be greatly appreciated.

> =A0

> Martin Bergek

> martin.bergek@home.se

> =A0

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