Creating Libraries
From KDevelop
How to build libraries in KDevelop:
I've tried this in KDevelop 3.1.2, and the following steps work for me:
1. Creating an application project
Use the project wizard (Project->New Project) to create a project, choosing the type to match the kind of library you want to make as close as possible
2. Adding a target
Open the Automake Manager (by default on the right side). In the top pane, click the "Add target" button. Choose 'Library' as target type for a .a library and adjust the settings to your liking. When clicking OK, the target will show up in the bottom pane.
3. Adding files
In the bottom pane, right click on the library target. Add new or existing files as desired.
4. Activating
In the bottom pane, right click on the library target. Select "Make Target Active".
After this, automake & friends should run on first build as usual, and you should be able to build your library. You can add other targets to the same project - for example a program target that includes an application entry point for unit testing of your lib.
To build a dynamic library inside an existing project with a CORRECT soname (with the .so extension name) in KDevelop 3.1.2, you need to change the ltmain.sh script.
Apparently, the ltmain.sh 1.5a along with KDevelop produces bad soname's (without .so). Be sure libtool >= 1.5.6 is installed. Then, copy /usr/share/libtool/ltmain.sh into your main project's directory. So you could now add a library sub-project.
- Add a sub-project "libfoo"
- Add a target
- Choice "Library (libtool)"
- Choice "lib"
- Put your library name "foo.so"
- Add your files
- Configure and build it.
Now, you should have a new library named libfoo.so.0.0.0 :-)