Clients in server

in Help Center
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
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
0
Comments
If you're still having trouble, please provide more information:
Take care,
- 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::operator==(struct PLDBRequest const &)const " ([email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
Que.obj : error LNK2005: "public: bool __thiscall PLDBRequest::operator!=(struct PLDBRequest const &)const " ([email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
Que.obj : error LNK2005: "public: bool __thiscall PLDBRequest::operator<(struct PLDBRequest const &)const " ([email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
Que.obj : error LNK2005: "public: void __thiscall PLDBRequest::__write(class IceInternal::BasicStream *)const " ([email protected]@@Z) already defined in DBWatcherThread.obj
Que.obj : error LNK2005: "public: void __thiscall PLDBRequest::__read(class IceInternal::BasicStream *)" ([email protected]@@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 " ([email protected]
[email protected]@QBEXABV[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@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 &)" ([email protected]
[email protected]@QAEXABV[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::incRef(class PLDBServer *)" ([email protected]@@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::decRef(class PLDBServer *)" ([email protected]@@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::incRef(class IceProxy::PLDBServer *)" ([email protected]@@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "void __cdecl IceInternal::decRef(class IceProxy::PLDBServer *)" ([email protected]@@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> &)" ([email protected]@@YAXABV[email protected]
@[email protected]@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> &)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected]@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> &)" ([email protected]@@YAXABV?$ProxyHan
@[email protected]@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> &)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected]@Z) already de
fined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "void __cdecl __write(class IceInternal::BasicStream *,class IceInternal::ProxyHandle<class IceProxy::PLDBServer> const &)" ([email protected]@[email protected]@@[email protected]@Z) alrea
dy defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "void __cdecl __read(class IceInternal::BasicStream *,class IceInternal::ProxyHandle<class IceProxy::PLDBServer> &)" ([email protected]@[email protected]@@[email protected]@Z) already defin
ed in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "void __cdecl __write(class IceInternal::BasicStream *,class IceInternal::Handle<class PLDBServer> const &)" ([email protected]@[email protected]@@[email protected]@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 &)" ([email protected]@[email protected]@ABV[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected]@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 &)" ([email protected]@YAXABV[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@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> &)" ([email protected]@YAXABV[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@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 &)" ([email protected]@YAXABV[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@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> &)" ([email protected]@YAXABV[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "public: bool __thiscall PLDBRequest::operator==(struct PLDBRequest const &)const " ([email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "public: bool __thiscall PLDBRequest::operator!=(struct PLDBRequest const &)const " ([email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "public: bool __thiscall PLDBRequest::operator<(struct PLDBRequest const &)const " ([email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "public: void __thiscall PLDBRequest::__write(class IceInternal::BasicStream *)const " ([email protected]@@Z) already defined in DBWatcherThread.obj
PLDBServer.obj : error LNK2005: "public: void __thiscall PLDBRequest::__read(class IceInternal::BasicStream *)" ([email protected]@@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
[email protected][email protected]@QBEXABV[email protected][email protected]@[email protected]@V[email protected]@[email protected]@[email protected]@Z) already defined in DBWatcherThread.obj
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
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
Have fun,
- Mark