I try to create a shared library with gcc compiler on hp-ux. I use these commands:
- gcc -Wall -fPIC -std=gnu99 -c *.c
- gcc -shared -Wl -o my_library.so *.o
Everything compiles without warnings or errors, but when I try to use that library, I get an error:
ERROR: Extension Load Failure: OS Error: -1 ('path_to_lib' is not a valid load module: Bad magic number).
ERROR: Unable to load extension: (path_to_lib).
ERROR: Extension Load Failure: OS Error: -1 ('path_to_lib' is not a valid load module: Bad magic number)
Do you know what does this error exactly mean? How to fix it?
EDITED: I use my shared library in SAS program like this:
proc proto package =work.myfuncs.tests;
link "/home/my_library.so";
int test(int x);
run;