Creating/using shared libraries

Sisyphus kalinabears@iinet.net.au
Sun Feb 1 22:30:00 GMT 2004


Frank wrote:
> Trying to  move from archive to shared libraries for an application. I 
> believe I was able to create the shared library ok by compiling the 
> .cpp's with -fpic and using g++ -shared with the objects (.o's).  But 
> when I try to compile a program that used that library I get a undefined 
> reference from the shared library about an archive library object that 
> it was compiled with (it was included on the link fro both the shared 
> lib and the executable). Is there some other option/procedure I need to 
> do to use the shared library?
> 
> Any good reference to understand how to build and use shared libraries.  
> I'm using GNU gcc/make
> 

http://vergil.chemistry.gatech.edu/resources/programming/c-tutorial/libraries.html

You still need to link to the static library when building the app.

Hope I've understood you correctly.

Cheers,
Rob

-- 
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.



More information about the Gcc-help mailing list