0

Possible Duplicate:
Convert a Static Library to a Shared Library (create libsome.so from libsome.a): where’s my symbols?

In compiling C++ with Cmakefile, how can I create a dynamic library .so file out of .a static library file?

halfer
  • 19,824
  • 17
  • 99
  • 186
olidev
  • 20,058
  • 51
  • 133
  • 197

1 Answers1

2

If you are building the library, you are using CMake (as I guess from your question), and it is defined like this:

add_library(name-of-library
    source1.cpp
    source2.cpp
)

You can add the type of library you want to build after the name of the library. It can be STATIC or SHARED. So if you want to build a shared library (.so), then the above should be transformed like this:

add_library(name-of-library SHARED
    source1.cpp
    source2.cpp
)

Hope this helps.

Lyubomir Vasilev
  • 3,000
  • 17
  • 24