[mercury-users] shared libraries

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 30 12:17:42 AEDT 2000


On 30-Nov-2000, Michael Day <mikeday at corplink.com.au> wrote:
> 
> When linking a Mercury program with an external C library, the Mercury
> linker always tries to link with the static version of the library rather
> than the shared. ie, if libfoo.a and libfoo.so are both available, it
> tries to link with libfoo.a. If libfoo.a is not present, it can't seem to
> see libfoo.so at all. (This being on Linux).
> 
> Is my system just configured badly with regards to shared libraries, or is
> there some flag I need to pass to Mercury to get it to link with them?

Currently the default on Linux is to use static libraries rather than
shared libraries.  (It ought to be the other way round, but unfortunately
implementing that is a little tricky and we haven't done it yet.)
So you to use shared libraries on Linux, you need to use
`mmc --pic-reg --link-flags --shared', or put `MGNUCFLAGS=--pic-reg'
and `MLFLAGS=--shared' in your Mmakefile.

See README.Linux for details.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list