Shared libraries (.so files)

Kdevelop allows to create a libtool library easily. From time to time we need something simplier, however, like standard shared library. You can create one without modyfying Makefiles by hand. Even Kdevelop FAQ has a section about it. The method works, but the author doesn't clearly write where is every needed option.

You can create a .so library in KDevelopie (my version is 3.2.0) this way:

  1. Open Automake Manager — with default config it's one of the tabs on the right.
  2. Create new subproject for your shared libraries. You can name it plugins if your libraries will be plugins.
  3. In the new subproject create new target with the following options:
    Primary: Program
    Prefix: noinst
    File name: insert your library full name here eg. libmy_library.so
    Below, in linker options (Others: field) type -shared
  4. Right-click on the subproject, choose Options and on the first tab (Compiler) fill options for the right compiler (CFLAGS or CXXFLAGS). You need -fPIC.
  5. To be sure I've changed linker options for the new target. To get to them right-click on the target library (lower window of Automake Manager) and choose Options from the menu, then Options tab. I've filled the Others: field with -version-info 0:0:1 -shared (0:0:1 is my version number).