Hi everyone,
I'm a bit of a newbie when it comes to the mainframe in general, but I'm hoping someone can help me out. I'm playing around with calling a Metal-C function from another (non-Metal) C module. I saw this thread and I was able to compile and run the following as the author there did. However, now I'm trying to compile a 64-bit version instead (using the lp64 option), but I'm getting some binder errors.
I compile with this sequence of USS commands:
xlc -Wc,metal,longname,lp64 -S metal.cas -mgoff metal.sxlc -Wc,lp64 -c driver.cxlc -Wl,lp64 driver.o metal.o
The last one results in this error:
IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO metal_function FROM SECTION driver#C DO NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON 2
The reason code explanation for IEW2469E apparently is: The xplink attributes of the reference and target do not match.
If I remove the lp64 option, my code compiles nicely and runs, so I'm not sure what to do to compile it as 64-bit. Does anyone have any ideas?
metal.c
#pragma prolog(metal_function,main)#pragma epilog(metal_function,main)int metal_function() { return 42;}
driver.c
#include <stdio.h>int metal_function();int main() { int result = metal_function(); printf("Result: %d\n", result); return 0;}
acrimon86