Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* How to make a dynamic linked library?
@ 1999-04-17  4:00 Huizhu Liu
  1999-04-23  4:00 ` Doug Hockin
  0 siblings, 1 reply; 3+ messages in thread
From: Huizhu Liu @ 1999-04-17  4:00 UTC (permalink / raw)


I am looking for information on how to make some c++ codes to a dynamic
linked library and the library will be loaded by a ruunning program
wriiten in C. I am using GNU comipler. Thanks.

huizhu




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to make a dynamic linked library?
  1999-04-17  4:00 How to make a dynamic linked library? Huizhu Liu
@ 1999-04-23  4:00 ` Doug Hockin
  1999-04-23  4:00   ` tomx
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Hockin @ 1999-04-23  4:00 UTC (permalink / raw)


I don't have experience with the GNU compiler but can give
suggestions for SVR4 and they are probably similar.

Compile the program with the -Kpic option to produce position
independent
code.  Then link it with -dy (to get it dynamically linked) and -G (to 
make it a shared library).

When you compile/link the programs that will use the library you need
to link them
with a -l option.  If you name your library libmine and put it into
/usr/lib then you can use -lmine.  If you put the library somewhere
else you'll also need to use -Lpath to specify the path to your library.
The -L option should precede the -l option on the command line.

-- Doug



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to make a dynamic linked library?
  1999-04-23  4:00 ` Doug Hockin
@ 1999-04-23  4:00   ` tomx
  0 siblings, 0 replies; 3+ messages in thread
From: tomx @ 1999-04-23  4:00 UTC (permalink / raw)


The GNU equivalents are: "-shared" to produce a shared object, and
"-fpic" to generate position-independent-code...

-Gigy Thomas

In article <3720B83D.BD17BAB2@wang.com>,
  Doug Hockin <doug.hockin@wang.com> wrote:
> I don't have experience with the GNU compiler but can give
> suggestions for SVR4 and they are probably similar.
>
> Compile the program with the -Kpic option to produce position
> independent
> code.  Then link it with -dy (to get it dynamically linked) and -G (to
> make it a shared library).
>
> When you compile/link the programs that will use the library you need
> to link them
> with a -l option.  If you name your library libmine and put it into
> /usr/lib then you can use -lmine.  If you put the library somewhere
> else you'll also need to use -Lpath to specify the path to your library.
> The -L option should precede the -l option on the command line.
>
> -- Doug
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-04-23  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-04-17  4:00 How to make a dynamic linked library? Huizhu Liu
1999-04-23  4:00 ` Doug Hockin
1999-04-23  4:00   ` tomx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox