C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Shared Libraries in C/C++/PRO C under Unix by g++ Posted by sandeept_24 on 24 Jul 2006 at 12:28 AM
Hi all
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.






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.