static and shared libs in Linux?, also makefile for them needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tvnaidu
    Contributor
    • Oct 2009
    • 365

    static and shared libs in Linux?, also makefile for them needed

    I have windows code to port to Linux, there are some static libraries like xyz.lib, also shared libs ABC.dll, I have to convert those static and shared libs (basically static will be used to make shared) to Linux, what is the extension in Linux (shared is .so, static is .lib?), can I get some sample makefile for static libs and shared libs?. thanks.
  • tvnaidu
    Contributor
    • Oct 2009
    • 365

    #2
    I have Three c files and include directory parallel to these c files, trying to create a shared lib (util.so), but fails with this command.
    gcc xyz1.c
    gcc xyz1.c
    gcc xyz1.c

    gcc -g -O2 -I/include -shared -fPIC -L. -lutil.so -Wl xyz1.o xyz2.o xyz3.o

    Comment

    Working...