|
|
|
|||||
|
Clients in server
Hi,
I have two servers. Is there an example of how to embed a client in server 1 making a call to server2? If not can you give me some idea on how to this? I get everything to compile but get lots of link errors about methods being already defined. Thanks for your help, John |
|
|||||
|
Hi Mark,
Thanks for your reply. I looked at the nested example and I'm not sure I have the same situation. The compiler is VC++ 6.0 on Windows XP. Below is a partial list of the link errors. I have two different ice files (Que.ice and PLDBServer.ice). One server (Que.cpp) is a queing server to feed several different (PLDBServer.cpp) servers. I create a thread using the IceUtil Thread class in the Que server and try to create a client to the PLDBServer in there. This is where I'm getting the link errors. I'll look at the nested example in more detail (been in meetings all day) and see what's going on there. Thanks for your help, John Deleting intermediate files and output files for project 'QServer - Win32 Release'. --------------------Configuration: QServer - Win32 Release-------------------- Compiling... DBWatcherThread.cpp QServer.cpp Que.cpp QueManagerI.cpp PLDBServer.cpp Linking... Que.obj : error LNK2005: "public: bool __thiscall PLDBRequest: perator==(struct PLDBRequest const &)const " (??8PLDBRequest@@QBE_NABU0@@Z) already defined in DBWatcherThread.objQue.obj : error LNK2005: "public: bool __thiscall PLDBRequest: perator!=(struct PLDBRequest const &)const " (??9PLDBRequest@@QBE_NABU0@@Z) already defined in DBWatcherThread.objQue.obj : error LNK2005: "public: bool __thiscall PLDBRequest: perator<(struct PLDBRequest const &)const " (??MPLDBRequest@@QBE_NABU0@@Z) already defined in DBWatcherThread.objQue.obj : error LNK2005: "public: void __thiscall PLDBRequest::__write(class IceInternal::BasicStream *)const " (?__write@PLDBRequest@@QBEXPAVBasicStream@IceInter nal@@@Z) already defined in DBWatcherThread.obj Que.obj : error LNK2005: "public: void __thiscall PLDBRequest::__read(class IceInternal::BasicStream *)" (?__read@PLDBRequest@@QAEXPAVBasicStream@IceIntern al@@@Z) already defined in DBWatcherThread.obj Que.obj : error LNK2005: "public: void __thiscall PLDBRequest::ice_marshal(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInternal::Handle<class Ice::Stream> const &)const " (?ice_marshal@P LDBRequest@@QBEXABV?$basic_string@DV?$char_traits@ D@_STL@@V?$allocator@D@2@@_STL@@ABV?$Handle@VStrea m@Ice@@@IceInternal@@@Z) already defined in DBWatcherThread.obj Que.obj : error LNK2005: "public: void __thiscall PLDBRequest::ice_unmarshal(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInternal::Handle<class Ice::Stream> const &)" (?ice_unmarshal@PLD BRequest@@QAEXABV?$basic_string@DV?$char_traits@D@ _STL@@V?$allocator@D@2@@_STL@@ABV?$Handle@VStream@ Ice@@@IceInternal@@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::incRef(class PLDBServer *)" (?incRef@IceInternal@@YAXPAVPLDBServer@@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::decRef(class PLDBServer *)" (?decRef@IceInternal@@YAXPAVPLDBServer@@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::incRef(class IceProxy::PLDBServer *)" (?incRef@IceInternal@@YAXPAVPLDBServer@IceProxy@@@ Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::decRef(class IceProxy::PLDBServer *)" (?decRef@IceInternal@@YAXPAVPLDBServer@IceProxy@@@ Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::checkedCast(class IceInternal::ProxyHandle<class IceProxy::Ice::Object> const &,class IceInternal::ProxyHandle<class IceProxy::PLDBServer> &)" (?checkedCast@IceInternal@@YAXABV?$ProxyHandle@ VObject@Ice@IceProxy@@@1@AAV?$ProxyHandle@VPLDBSer ver@IceProxy@@@1@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::checkedCast(class IceInternal::ProxyHandle<class IceProxy::Ice::Object> const &,class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInt ernal::ProxyHandle<class IceProxy::PLDBServer> &)" (?checkedCast@IceInternal@@YAXABV?$ProxyHandle@VOb ject@Ice@IceProxy@@@1@ABV?$basic_string@DV?$char_t raits@D@_STL@@V?$allocator@D@2@@_STL@@AAV?$ProxyHa ndle@VPLDBServer@IceProxy@@@1@@Z) already define d in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::uncheckedCast(class IceInternal::ProxyHandle<class IceProxy::Ice::Object> const &,class IceInternal::ProxyHandle<class IceProxy::PLDBServer> &)" (?uncheckedCast@IceInternal@@YAXABV?$ProxyHan dle@VObject@Ice@IceProxy@@@1@AAV?$ProxyHandle@VPLD BServer@IceProxy@@@1@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::uncheckedCast(class IceInternal::ProxyHandle<class IceProxy::Ice::Object> const &,class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceI nternal::ProxyHandle<class IceProxy::PLDBServer> &)" (?uncheckedCast@IceInternal@@YAXABV?$ProxyHandle@V Object@Ice@IceProxy@@@1@ABV?$basic_string@DV?$char _traits@D@_STL@@V?$allocator@D@2@@_STL@@AAV?$Proxy Handle@VPLDBServer@IceProxy@@@1@@Z) already de fined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl __write(class IceInternal::BasicStream *,class IceInternal::ProxyHandle<class IceProxy::PLDBServer> const &)" (?__write@@YAXPAVBasicStream@IceInternal@@ABV?$Pro xyHandle@VPLDBServer@IceProxy@@@2@@Z) alrea dy defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl __read(class IceInternal::BasicStream *,class IceInternal::ProxyHandle<class IceProxy::PLDBServer> &)" (?__read@@YAXPAVBasicStream@IceInternal@@AAV?$Prox yHandle@VPLDBServer@IceProxy@@@2@@Z) already defin ed in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl __write(class IceInternal::BasicStream *,class IceInternal::Handle<class PLDBServer> const &)" (?__write@@YAXPAVBasicStream@IceInternal@@ABV?$Han dle@VPLDBServer@@@2@@Z) already defined in DBWatcherThread .obj PLDBServer.obj : error LNK2005: "void __cdecl __writeObject(class IceInternal::Handle<class Ice::Stream> const &,class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInternal::Handle<class PLDBSe rver> const &)" (?__writeObject@@YAXABV?$Handle@VStream@Ice@@@IceI nternal@@ABV?$basic_string@DV?$char_traits@D@_STL@ @V?$allocator@D@2@@_STL@@ABV?$Handle@VPLDBServer@@ @2@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl ice_marshal(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInternal::Handle<class Ice::Stream> const &,class IceInternal::Handle<class PLDBServ er> const &)" (?ice_marshal@@YAXABV?$basic_string@DV?$char_trait s@D@_STL@@V?$allocator@D@2@@_STL@@ABV?$Handle@VStr eam@Ice@@@IceInternal@@ABV?$Handle@VPLDBServer@@@4 @@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl ice_unmarshal(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInternal::Handle<class Ice::Stream> const &,class IceInternal::Handle<class PLDBSe rver> &)" (?ice_unmarshal@@YAXABV?$basic_string@DV?$char_tra its@D@_STL@@V?$allocator@D@2@@_STL@@ABV?$Handle@VS tream@Ice@@@IceInternal@@AAV?$Handle@VPLDBServer@@ @4@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl ice_marshal(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInternal::Handle<class Ice::Stream> const &,class IceInternal::ProxyHandle<class Ice Proxy::PLDBServer> const &)" (?ice_marshal@@YAXABV?$basic_string@DV?$char_trait s@D@_STL@@V?$allocator@D@2@@_STL@@ABV?$Handle@VStr eam@Ice@@@IceInternal@@ABV?$ProxyHandle@VPLDBServe r@IceProxy@@@4@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "void __cdecl ice_unmarshal(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInternal::Handle<class Ice::Stream> const &,class IceInternal::ProxyHandle<class I ceProxy::PLDBServer> &)" (?ice_unmarshal@@YAXABV?$basic_string@DV?$char_tra its@D@_STL@@V?$allocator@D@2@@_STL@@ABV?$Handle@VS tream@Ice@@@IceInternal@@AAV?$ProxyHandle@VPLDBSer ver@IceProxy@@@4@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "public: bool __thiscall PLDBRequest: perator==(struct PLDBRequest const &)const " (??8PLDBRequest@@QBE_NABU0@@Z) already defined in DBWatcherThread.objPLDBServer.obj : error LNK2005: "public: bool __thiscall PLDBRequest: perator!=(struct PLDBRequest const &)const " (??9PLDBRequest@@QBE_NABU0@@Z) already defined in DBWatcherThread.objPLDBServer.obj : error LNK2005: "public: bool __thiscall PLDBRequest: perator<(struct PLDBRequest const &)const " (??MPLDBRequest@@QBE_NABU0@@Z) already defined in DBWatcherThread.objPLDBServer.obj : error LNK2005: "public: void __thiscall PLDBRequest::__write(class IceInternal::BasicStream *)const " (?__write@PLDBRequest@@QBEXPAVBasicStream@IceInter nal@@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "public: void __thiscall PLDBRequest::__read(class IceInternal::BasicStream *)" (?__read@PLDBRequest@@QAEXPAVBasicStream@IceIntern al@@@Z) already defined in DBWatcherThread.obj PLDBServer.obj : error LNK2005: "public: void __thiscall PLDBRequest::ice_marshal(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class IceInternal::Handle<class Ice::Stream> const &)const " (?ice_ma rshal@PLDBRequest@@QBEXABV?$basic_string@DV?$char_ traits@D@_STL@@V?$allocator@D@2@@_STL@@ABV?$Handle @VStream@Ice@@@IceInternal@@@Z) already defined in DBWatcherThread.obj |
|
||||||
|
John,
These errors look pretty strange. If I didn't know better, I'd guess that DBWatcherThread.cpp was including a .cpp file where it should have been including a .h file. That's the only explanation I can find for the case where DBWatcherThread.obj contains definitions of Slice-generated functions for PLDBRequest types. If you still can't figure it out, you'll probably need to send us an archive with your files and VC project(s). Or, if you can't send us your code, send us a generic example that reproduces the same problem. - Mark |
|
|||||
|
Hi Mark,
You were right - sorry about that. I changed the include to the proper include file and now get 8 link errors. I think I know what these are I have the same struct defined in each Ice file. I'll change that and anticpate no problems. Thanks again and sorry for the typo. John |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What will the clients do when the servers be killed? | AaronIct | Help Center | 1 | 02-26-2007 07:15 AM |
| Hot to connet two clients that all are private IP or behind the firewall? | level | Help Center | 0 | 03-06-2006 09:01 PM |
| SSL support for Java clients? | annekat | Help Center | 12 | 04-18-2005 09:49 PM |
| icestorm max clients | diddek | Help Center | 1 | 10-18-2004 04:45 PM |