[omniORB] CORBA::Any and struct
xanith@web.de
xanith@web.de
Thu, 6 Dec 2001 18:35:53 +0100
Hi,
I want to send CORBA::Any's on an EventChannel filled up with a struct. As documentated in the
userguide I added something like that in my idl file:
-- IDL --
struct eventStruct {
short id;
short val;
}
-- IDL --
I recompiled everything with "omniidl -bcxx -Wba file.idl".
In my PushSupplier Class I got something like that:
-- C++ --
CORBA::Any* data = new CORBA::Any;
eventStruct eSt;
eSt.id = 3;
eSt.val = 1;
*data <<= eSt;
[...]
try { myProxy->push(*data); }
[...]
delete data;
-- C++ --
Well, everything compiles, but linkage breaks with the following:
-- bash --
+ /usr/bin/g++ -o project_i -O2 -Wall -Wno-unused -Wl,-rpath,../../../../lib/i586_linux_2.0_glibc2.1
-L../../../../lib/i586_linux_2.0_glibc2.1 project_i.o ../../../../stub/projectSK.o -lomniORB3
-lomniDynamic3 -ltcpwrapGK -lomnithread -lpthread -lomnithread -lpthread -lCOS3 -lCOSDynamic3
project_i.o: In function `PushSupplier_i::doit(void *)':
project_i.o(.text+0x4382): undefined reference to `operator<<=(CORBA::Any &, eventStruct const &)'
collect2: ld returned 1 exit status
-- bash --
I saw that the operator<<= function is just declared as extern in projectSK.cc but is defined in
projectDynSK.cc, therefore I changed some libs with nodyn in dir.mk to normal libs.
Oh, I should have mentioned that supplieng some simple CORBA::ULong is no problem, only got a
problem with that struct.
Perhaps one of you know what's wrong with that...
Thanks a lot in advance,
-xanth-
______________________________________________________________________________
Hollywood unterm Weihnachtsbaum + ExtraPraemie bei WEB.DE
http://premiere.web.de