This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: how to create shared library under solaris


[Posted and mailed]

In article <Uv_Q3.2727$0k2.36987@stones>,
	"Roger Woodward" <rogerw@autogrouper.co.uk> writes:
> can anyone point me to some good documentation on and/or
> outline the salient
> points of creating a shared library using GNU C++.
> 
> the man pages do not go beyond listing -fpic and -shared
> as compile and link
> options and i would like to understand whats required.

gcc -fPIC -c source.c
gcc -o library.so -shared source.o

Should work. You can give the shared lib an 
soname by using

gcc -o library.so -Wl,-h,library.so -shared source.o

Hope this helps,
Martin.

-- 
The early bird gets the worm. If you want something else for       
breakfast, get up later.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]