Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shared Libraries in C/C++/PRO C under Unix by g++

sandeept_24sandeept_24 Member Posts: 8
Hi all
I created a shared library for a PRO *C program abc.pc as 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/[email protected]
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.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.

Sign In or Register to comment.