[omniORB] Problems with Link - LNK2019

Pedro Ribeiro pedroribeirojr at gmail.com
Thu Jan 13 19:23:30 GMT 2005


I've notice that many people put a lot of link errors when compiling,
but I'd like to put mine here  because it seems a little different of
the others..

First I like to explain what I am doing ...

All my servants will use  _tie templates. and they will be called
controllers, they are in separated directory AND have their own
make/build becaming a lib, not a exe nor a dll. That's build goes ok,
and I believe that I dont need to link orb libs with then...well... if
I put in the command line it brings me a 1000 warnings. if I don't put
the orb libs, it does not complain.
I also believe that this could be a normal thing to do - lib.exe to do
not complain about the other libs - because it implies that I gonna
use the others to link that to another application...correct me if I
am wrong...


Then I create <my_application>_server a unique binary application that
will run orbs and there it will bind all my servants, at one place...

 That's must sound weard since I am newbie and didnt had time to read
about any other feature of  CORBA as a central place.... but at least
it is a central place to instanciate that and I can change in the
future.

but when I link I've got many unresolved external link erros from the
<servant>.lib wich comes from the lib that I previously build with
success

domain_controllers.lib(usercontrollerSK.obj) : error LNK2019:
unresolved external symbol "bool __stdcall
_CORBA_use_nil_ptr_as_nil_objref(void)"
(?_CORBA_use_nil_ptr_as_nil_objref@@YG_NXZ) referenced in function
"bool __stdcall CORBA::is_nil(class CORBA::Object *)"
(?is_nil at CORBA@@YG_NPAVObject at 1@@Z)

domain_controllers.lib(usercontrollerSK.obj) : error LNK2019:
unresolved external symbol "void __stdcall omni::releaseObjRef(class
omniObjRef *)" (?releaseObjRef at omni@@YGXPAVomniObjRef@@@Z) referenced
in function "void __stdcall CORBA::release(class CORBA::Object *)"
(?release at CORBA@@YGXPAVObject at 1@@Z)

at total of  12 and comming from SK and Impl (the one implemented).

I am using cygwin/make with MS's  cl and link.exe, but not in Visual
Studio...( I addicted to jEdit) and linking using the -verbose option
that can be sent if necessary.

All the libs are refered correctly in link command line : 
link -nologo -verbose -out:mml_server.exe  omniORB405_rt.lib
omnithread30_rt.lib omniDynamic405_rt.lib msvcstub.lib
-NODEFAULTLIB:libcmt.lib -NODEFAULTLIB:libcmtd.lib  ws2_32.lib
mswsock.lib advapi32.lib -libpath:D:\dev\omniORB-4.0.5\lib\x86_win32
-libpath:../../bin/Release domain_vo.lib domain_controllers.lib  
mml_server..obj

for aditional information  I also created a template that will receive
my implementation server and its _tie template and also binding
name....
template <class T_impl, class T_tie> 
....//similar to code from examples/echo/eg3_tieimpl.cc
    T_impl * obj_impl = new T_impl();
    T_tie obj_tie(obj_impl);
    PortableServer::ObjectId_var obj_id = poa->activate_object(&obj_tie);
    CORBA::Object_var obj = obj_tie._this();
    if( !bindObjectToName(orb, obj) )

it compiles ok...and the linker did not complained about ..

Thanks for the help... and sorry if this mail was too long...and
grammatically incorrect.
 
Pedro



More information about the omniORB-list mailing list