I am attempting to compile a simple C program into a .so file using the cc compiler on an AIX system. The program is:
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello, world\n");
return 0;
}
First, I created a .o file using the following:
cc -c -fPIC hello_world.c -o hello_world.o
This seems to work, but then when I attempt to create the .so file using:
cc hello_world.o -shared -o hello_world.so
I get the following errors:
ld: 0706-012 The -h flag is not recognized.
ld: 0706-012 The -a flag is not recognized.
Can anyone tell me what might be causing these errors?