[mercury-users] Compilation errors with Mercury and GTK--

Andy Coates coates_andy at hotmail.com
Sat Feb 2 03:44:49 AEDT 2002

I'm currently writing a application in C++, using the GTK-- wrappers for 
I needed to write an NLP module and after reading the documentation and 
general comments on Mercury I decided to write a simple parser in Mercury 
and try to integrate it with my existing code.

I have written said parser, which has the following predicate as its 
:- pred m_parse( list(char)::int, list(char)::out) is cc_multi.

I then export it like so:
:- pragma export(m_parse(in, out), "m_parse").

I then compiled myparser.m into an object file using
mmc -Ec myparser

All well and good so far (at least I think so!).
Within my C++ code;  main.cc includes mercury_imp.h and myparser.h, and i am 
now trying to compile it all together using g++.

My problem is that I cannot get the Mercury source and the GTK sources to 
play nice :(

I get different compiler errors depending on the order of the #includes in 

If I #include the mercury libraries first (as in the examples provided with 
the distribution) I get a whole load of errors about macro calls made from 
the GTK source code with too many arguments, and i'm not about to go in and 
change that code, as it used to compile fine!

If I include the mercury libraries after I have included <gtk--.h> then g++ 
complains that mercury_bootstrap.h has a declaration that doesnt actually 
declare anything!

I don't really want to change the Mercury Source code either, so is there 
something obvious I haven't tried yet?!

I then recreated the exact same errors simply by adding
#include <gtk--.h> to cpp_main.cc in the examples directory, and adding an 
include path to the Mmakefile.

if anyone has any suggestions, please let me know.


Join the world’s largest e-mail service with MSN Hotmail. 
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