[omniORB] linking corba program problem
Alex Tingle
alex.omniorb at firetree.net
Sun Sep 5 19:47:02 BST 2004
On Sun, 5 Sep 2004 10:04:26 -0700 (PDT)
Andre Kirchner <supercroc1974 at yahoo.com> wrote:
> I'm trying to compile my first Corba program, but
> without sucess until now. The following steps show
> what I'm doing, and any help would be very much
> appreciated :-)
>
> I have created a very simple interface in the file
> Test.idl, and used "omniidl -bcxx -Wbh=SK.hh -D
> __linux__ -D __x86__ -D __OSVERSION__=2 -D
> __OMNIORB4__ Test.idl" to generate the files TestSK.hh
> and TestSK.cc.
> Then I used "g++ -D __linux__ -D __x86__ -D
> __OSVERSION__=2 -D __OMNIORB4__ -c TestSK.cc" and "g++
> -D __linux__ -D __x86__ -D __OSVERSION__=2 -D
> __OMNIORB4__ -c main.ccp" to generate the main.o and
> TestSK.o object files.
> But when I use the comand "g++ -o main.out *.o -l
> omniORB4" to created the executable, a bunch of
> undefined reference erros like the following are
> returned
>
> ./TestSK.o(.text+0x2dd): In function `test::_nil()':
> : undefined reference to `operator delete(void*)'
> ./TestSK.o(.text+0x302): In function `test::_nil()':
> : undefined reference to `operator delete(void*)'
> ./TestSK.o(.text+0x339): In function `test::_nil()':
> : undefined reference to
> `omni::registerNilCorbaObject(CORBA::Object*)'
>
> I'm using omniOrb4 on a RedHat9 system.
Is `omni::registerNilCorbaObject(CORBA::Object*)' defined in your
omniORB4 library? Try this:
% nm -C libomniORB4.a | grep registerNilCorbaObject
On my box, this gives...
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
000026c0 T omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
U omni::registerNilCorbaObject(CORBA::Object *)
...the 'T' record shows that the method is defined in this library. If
you can't find this method in the library then the library has been
built incorrectly.
Don't you need a `-pthread' flag too?
-Alex
--
:: alex tingle
:: 58 kings way, harrow, mddx. uk. HA1 1XU
:: alex.tingle AT firetree.net +44-7901-552763
More information about the omniORB-list
mailing list