Discussion:
[omniORB] Opaque linking error
Hamilton Temple
2008-07-05 16:04:45 UTC
Permalink
Hi, I'm new to omniORB. I obtained the following error while I was compiling
a simple
client I found in the examples:


g++ -c HelloSK.cc -I/usr/local/include
g++ -c client.cpp -I. -I/usr/local/include
g++ client.cpp HelloSK.o -L/usr/local/lib -lomniORB4 -lCOSDynamic4
-lomnithread -lomniDynamic4 -lws2_32 -o client.exe -I/usr/local/include


C:/WINDOWS/Temp/ccP9cu3Y.o:client.cpp:(.text$_ZN20_CORBA_String_helper4freeEPc[_CORBA_String_helper::free(char*)]+0xe):
undefined reference to `_imp___ZN20_CORBA_String_helper12empty_stringE'
C:/WINDOWS/Temp/ccP9cu3Y.o:client.cpp:(.text$_ZN20_CORBA_String_memberaSERKS_[_CORBA_String_member::operator=(_CORBA_String_member
const&)]+0x29): undefined reference to
`_imp___ZN20_CORBA_String_helper12empty_stringE'
C:/WINDOWS/Temp/ccP9cu3Y.o:client.cpp:(.text$_ZN20_CORBA_String_memberC1Ev[_CORBA_String_member::_CORBA_String_member()]+0x8):
undefined reference to `_imp___ZN20_CORBA_String_helper12empty_stringE'
HelloSK.o:HelloSK.cc:(.text+0x857): undefined reference to
`_imp___ZN5CORBA6Object10_PD_repoIdE'
HelloSK.o:HelloSK.cc:(.text+0x895): undefined reference to
`_imp___ZN5CORBA6Object10_PD_repoIdE'
HelloSK.o:HelloSK.cc:(.text+0xe27): undefined reference to
`_imp___ZN5CORBA6Object10_PD_repoIdE'
HelloSK.o:HelloSK.cc:(.text+0xe5c): undefined reference to
`_imp___ZN5CORBA6Object10_PD_repoIdE'
HelloSK.o:HelloSK.cc:(.text+0x13ea): undefined reference to
`_imp___ZN4omni11omniORB_4_1E'
HelloSK.o:HelloSK.cc:(.text$_ZN5CORBA6Object12_PR_is_validEPS0_[CORBA::Object::_PR_is_valid(CORBA::Object*)]+0x18):
undefined reference to `_imp___ZN5CORBA6Object9_PR_magicE'
HelloSK.o:HelloSK.cc:(.text$_ZN5CORBA6ObjectC2Ev[CORBA::Object::Object()]+0x1a):
undefined reference to `_imp___ZN5CORBA6Object9_PR_magicE'
collect2: ld returned 1 exit status

I have been googling but I am unable to find a clue. Which library is
missing?

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080705/9c97f76f/attachment.htm
Duncan Grisby
2008-07-07 15:22:02 UTC
Permalink
Post by Hamilton Temple
Hi, I'm new to omniORB. I obtained the following error while I was
g++ -c HelloSK.cc -I/usr/local/include
g++ -c client.cpp -I. -I/usr/local/include
g++ client.cpp HelloSK.o -L/usr/local/lib -lomniORB4 -lCOSDynamic4
-lomnithread -lomniDynamic4 -lws2_32 -o client.exe -I/usr/local/include
C:/WINDOWS/Temp/ccP9cu3Y.o:client.cpp:(.text$_ZN20_CORBA_String_helper4freeEPc
[_CORBA_String_helper::free(char*)]+0xe): undefined reference to
`_imp___ZN20_CORBA_String_helper12empty_stringE'
Are you trying to use the omniORB binary distribution with gcc? That
won't work because the binaries are compiled with Visual C++, and the
name mangling schemes are not compatible. You must either use Visual C++
to compile your code, or recompile omniORB itself with cygwin's g++.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Hamilton Temple
2008-07-08 19:39:03 UTC
Permalink
Hi, Duncan

In fact I compiled omniORB 4.1.2 with mingw32 (gcc version 3.4.5,
mingw-vista special r3). I think
that I read in the docs that it is supported. For me compiling with mingw32
would be much more
convenient than using cygwin.

Regards,

Hamilton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080708/8aab0406/attachment.htm
Loading...