LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   create a library (https://www.linuxquestions.org/questions/programming-9/create-a-library-199468/)

os2 06-30-2004 09:10 AM

create a library
 
hi

how to generate a .so, i have a program, i want to load a library... but i don't know how to generate a library file with gcc

thanks

nodger 06-30-2004 10:38 AM

youre not FROM canada wohwohwohwohwohwohwohwohwohwohhttp://bbs.adultwebmasterinfo.com/

coolman0stress 06-30-2004 11:30 AM

I can't remember exactly, but my notes mentioned this:
Code:

       
cc -c -fPIC app.c
cc -shared -o lib.so app.o


jschiwal 06-30-2004 04:21 PM

Here is a link to the publication 'Running Linux 3rd Edition' by Matt Welsh, Matthias Kalle Dalheimer, and Lar Kaufman
. The section on creating shared libraries is in section 13.1.7.1.

http://www.hk8.org/old_web/linux/run/ch13_01.htm

rshinoy 06-30-2004 10:29 PM

Hi ,
You can do it in the following way

g++ -shared -Wl,-soname, $(TARGET).so $(OBJS) $(LIBS)

where $(OBJS) are your several objectfiles
------------
regards
rshinoy


All times are GMT -5. The time now is 04:27 PM.