Well, part of it was that I needed to do -shared on Linux instead of -dynamiclib. On OSX, I have to use -dynamiclib.

It compiles now on the C code, but when I created a cmain.c to test the library, it gave me a segmentation fault when trying to run this compiled program, even though I copied gfunc.o and cfunc.o to /usr/lib on Linux.

// cmain.c
#include <stdio.h>
extern char * c_dfunc(char *s);

void main() {
        printf("%s\n",c_dfunc("request"));
}


Reply via email to