[mercury-users] shared library

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jan 12 08:13:59 AEDT 2004


On 10-Jan-2004, Marcus Vinicius Santos <m3santos at scs.ryerson.ca> wrote:
> I am having problems to generate a shared library out of the
> Mercury's hello.m sample program.
> 
> This is what I am doing:
> 
> 1- mmc --pic-reg -c hello.m
> 2- ml --shared -o libhello.so hello.o
...
> undefined reference to `main'

The "--shared" option tries to make an executable (that uses shared
libraries), not a shared library.  Naturally this won't work if you
don't have main/2 defined.

To make a shared library, you should use the "--make-shared-lib" option:

	ml --make-shared-lib -o libhello.so hello.o

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  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