[mercury-users] Problem with linking bigger project (Mercury and C++)

Simon Taylor stayl at cs.mu.OZ.AU
Sun Jan 6 01:14:56 AEDT 2002


On 05-Jan-2002, Ondrej Bojar <oboj7042 at ss1000.ms.mff.cuni.cz> wrote:
> I'm still unable to link together lots of Mercury modules and C++ main
> code.

> And the final step:
> 
> cd ling2
> mmake ent      # to link all .o files together
> 
> Fails with:
> 
> ent_init.o: In function `mercury_init':
> ent_init.o(.text+0x374): undefined reference to `<predicate 'main'/2 mode 0>'
> collect2: ld returned 1 exit status
> gmake: *** [ent] Error 1

If you define a Mercury main/2 predicate (it won't be used),
this problem will go away. I'm not sure why this is needed.
 
> # Files needed for the final linking.
> #MLOBJS-ent=db_cint.o $(MILANLIBS) $(main_objects)
> # XXX Strangely, the line above *doesn't work*. When "mmake ent" is called,
> # mmake *doesn't include* the $(main_objects) and includes just plain $(MLOBJS)

I've just fixed this bug.
 
Simon.
--------------------------------------------------------------------------
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