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

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 5 23:57:05 AEDT 2002


On 05-Feb-2002, Andy Coates <coates_andy at hotmail.com> wrote:
> 
> In file included from skaMain.cc:3:
> skaNLP.h:30: `MR_Word' was not declared in this scope
> skaNLP.h:30: parse error before `,'
> skaNLP.h:36: syntax error before `;'

It's very difficult to figure out exactly what is going on without a little
more context; what's at line 30 of skaNLP.h and immediately before it?
(`MR_Word' is supposed to be defined in "mercury_types.h",
which is included by "mercury_imp.h".)

> If I try the other approach, ie using mmake (with g++) passing the 
> -DMERCURY_NO_BOOTSTRAP_H option, and also using the highlevel code flag, 
> running mmake depend, followed by mmake yields many errors of the following 
> types:
> 
> 
> bash-2.05$ mmake
> rm -f skaNLP.c
> mmc --compile-to-c --high-level-code         skaNLP.m > skaNLP.err 2>&1
> MERCURY_C_COMPILER=g++ mgnuc --high-level-code     -g        -c skaNLP.c -o 
> skaNLP.o
> skaNLP.c:38: uninitialized const 
> `skaNLP__skaNLP__enum_name_ordered_v_type_0'
> skaNLP.m:221: redefinition of `const struct MR_EnumFunctorDesc *const 
> skaNLP__skaNLP__enum_name_ordered_v_type_0[2]'
> skaNLP.m:247: ANSI C++ forbids implicit conversion from `void *' in 
> initialization
> ..etc

This occurs because you are trying to compile the C files
that the Mercury compiler generates with g++, which is a C++
compiler, not a C compiler, and C++ isn't compatible with C.

(Even if you got it to compile, you'd probably get link errors,
because g++ generates object files with mangled function names...)

Try deleting the definitions of MGNUC and ML from your Mmakefile.

-- 
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