Compiling to use a dynamic lib
Steve Gums
sgums@voast.com
Wed Nov 14 10:57:00 GMT 2001
To Whom It Concerns
I have a probably rather simple question for someone. I am trying to figure
out how to use dynamic libraries with my application that I am going to run
on Solaris 8
I have included to two source files main.c and sqrint.c
I first create the library using the sqrint function with the following
command.
gcc -c -osqrint.o sqrint.c -fPIC
Then I create the library with
gcc -shared -fPIC -libshared.so sqrint.o
My problem comes when I try to compile the main.c I get unresolved symbols
for dlcose,dlopen, and dlsym with are in the dlfcn.h header file. I might
not be using the right options to compile with. Any help here would be
appreciated.
Thanks
Steve Gums
sgums@voast.com/303-225-3276
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: application/octet-stream
Size: 849 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20011114/c9fd0a6c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqrint.c
Type: application/octet-stream
Size: 234 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20011114/c9fd0a6c/attachment-0001.obj>
More information about the Gcc-bugs
mailing list