I created a shared library for a PRO *C program abc.pc as abc.so. I
want to use function fun() written inside this program using
dlopen(),dlsym() etc in another program test.c working on linux.Then at
dlsym it gives me dlerror() saying "./test: undefined symbol: fun".
Probably it is not able to resolve the symbol name "fun" from the
shared library. Following are the steps of making my shared library with linkage options:-
proc iname=abc.pc sqlcheck=full code=cpp user=scott/tiger@mydb
g++ -fPIC -g -c abc.c -I/oracle/precomp/public -I/oracle/rdbms/demo
-I/oracle/rdbms/public -L/oracle/lib /oracle/precomp/lib/cobsqlintf.o
-lclntsh `cat /oracle/lib/sysliblist` -lm
g++ -shared -o abc.so abc.o
g++ -o EXECUTE test.c -ldl
Now if I run by ./EXECUTE. It gives me following runtime error:-
./ EXECUTE: undefined symbol: fun
Moreover I am taking care of all the C linkage while compiling by
putting them as extern "C".
Kindly solve the problem if possible.