views:

100

answers:

1

I am tryng to create a shared library which internally is linking to many shared lib and a static lib . In my case my shared lib is not including static lib . I want to know what i am trying whether it is correct or i need to convert static lib to shared lib and then do the linking .

I need to know that is there any makefile flag which allow me to add static library along with shared lib .

Please suggest .

A: 

You can create a library which is dependent of other library (static and dynamic). But you need to integrate the static library part inside your (because this one can not be load dynamically)

dependence of your source code:
your_library -> static_library.lib
your_library -> dynamic_library.dll

how you implement can it (to be used by an executable):

your_library.dll (which contain your_library and static_library source code)
dynamic_library.dll (to distribute with your_library.dll)

or

your_library.dll
static_library.dll (to be created from the static_library.lib)
dynamic_library.dll (to distribute with your_library.dll)

edit: here may what you are looking for convert static library to shared library (it is for linux, but you will have the same for os):

.a files are just archives of .o object files, so all you need to do is unpack the archive and repackage them as a shared object (.so)
ar -x mylib.a
gcc -shared *.o -o mylib.so
Phong