[mercury-users] Where is MR_list_cons declared? (`MR_mr5' undeclared)

Ondrej Bojar oboj7042 at ss1000.ms.mff.cuni.cz
Thu Oct 25 18:24:58 AEST 2001


Hello.

  I'm trying to call C++ code from Mercury. Now, I managed to compile a
hello-world (using a C interface, extern "C" wrapped), but I need to share
a list(int) structure across the codes (there and back again).

  I'm able to send the list(int) data to the C function and to parse it
with MR_list_* macros.

  Unfortunately, I'm not able to create a list(int) in the C code:

MR_Word myoutlist;
int i;

myoutlist = MR_list_empty();
for(i=20; i>10; i--) {
    myoutlist =  MR_list_cons(i, myoutlist);
}


...reports MR_mr5 undeclared on the line where MR_list_cons is used.

  What should I #include? (I include only a "mercury_lib.h", a header file
generated automatically when compiling mercury_lib.m in the
cplusplus_calls_mercury samples directory.)

  Thanks for help, Andrew.

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