Client as shared object

in Help Center
Hi,
i'm trying to make Client.cpp (even that from manual) as postgresql funtion. So i compiled (under Linux) Server like manual says and in Client i replace "int main(int argc, char* argv[])" to "::Ice::Double ClientSquare(::Ice::Double x)". I create Client.h:
And i compiled this:
g++ -I. -I/home/include -fPIC -c -Wall Sqrt.cpp Client.cpp
g++ -shared -Wl,-soname,libsqrt.so.1 -o libsqrt.so.1.0.1 Sqrt.o Client.o -L/home/lib -lIce -lIceUtil
I don't know if i did that correct... Does anybody could tell me how to make client as shared object file?
Thanks for all suggestions
i'm trying to make Client.cpp (even that from manual) as postgresql funtion. So i compiled (under Linux) Server like manual says and in Client i replace "int main(int argc, char* argv[])" to "::Ice::Double ClientSquare(::Ice::Double x)". I create Client.h:
#ifndef __Client_h__ #define __Client_h__ double ClientSquare(double x); #endif
And i compiled this:
g++ -I. -I/home/include -fPIC -c -Wall Sqrt.cpp Client.cpp
g++ -shared -Wl,-soname,libsqrt.so.1 -o libsqrt.so.1.0.1 Sqrt.o Client.o -L/home/lib -lIce -lIceUtil
I don't know if i did that correct... Does anybody could tell me how to make client as shared object file?
Thanks for all suggestions
0
Comments
I recommend checking out the compilation of the IceBox hello service for an example on how to build a shared library, the demo is located in your demo/IceBox/hello directory.
Cheers,
Benoit.
Thanks for reply Benoit. But this example is for Windows and it shows how to make server as share library, and i would like make client as share object under linux. Does THIS example is also for me? I'm not very advanced in compiling under Linux.
The IceBox hello demo also has a Makefile to build the demo on Linux. Building an Ice client or an Ice server as a shared library is the same so I recommend checking out the build commands of this demo to figure out how to build your Ice program as a shared library on Linux.
If you are looking for instructions on how to write an Ice client (and not only how to build it), you should start with taking a look at demo/Ice/minimal/Client.cpp (and not the IceBox hello code which is not what you want). This minimal client demonstrates the code required at a minimum to make an Ice invocation on a server.
Cheers,
Benoit.
Cheers,
Benoit.
i always get error:
I working under Gentoo and i get Ice from emerge Ice, so i have installed
* dev-libs/Ice
Latest version available: 3.4.1
Latest version installed: 3.4.1
Size of files: 5,140 kB
Homepage: Welcome to ZeroC, the Home of Ice
Description: ICE middleware C++ library and generator tools
License: GPL-2
but i also see
* dev-cpp/IceE [ Masked ]
Latest version available: 1.3.0-r1
Latest version installed: [ Not Installed ]
Size of files: 1,222 kB
Homepage: ZeroC - Ice-E Overview
Description: The Internet Communications Engine (Ice) is a modern object-oriented middleware with support for C++, .NET, Java, Python, Ruby, and PHP
License: GPL-2
Should i install dev-cpp/IceE? I've read that that error shows when you don't have installed Ice, but i have dev-libs/Ice
dev-cpp/IceE
You can also try to update to Ice-3.4.2, build it from source , or unmask the Ice-3.4.2 package in gentoo portage.
To install 3.4.2 from gentoo portage.
Thanks for your help!