Im developing both a KPart and a standalone application, how do I avoid duplicated code?
Apps are often tempted to link to their part because they of course have much functionality in common. However this is wrong for the reasons below. • A lib is something you link to, a module is something you dlopen. You can’t dlopen a lib ; you can’t link to a module. • A lib has a version number and is installed in $libdir (e.g. $KDEDIR/lib) a module doesn’t have a version number (in its name), it’s more like a binary (we don’t have konqueror-1.14.23 either :), and is installed into kde_moduledir (e.g. $KDEDIR/lib/kde3) (which means it’s not in the search path for ld.so, so this breaks on systems without -rpath). • If you didn’t understand the above, don’t worry. The point is: you should NOT make your application link to your (or any other) KPart, nor any other kind of dlopened module.
Related Questions
- Describe the advantages of writing a managed code application instead of unmanaged one. What’s involved in certain piece of code being managed?
- How can I pass a certain value to the standalone application as a command line argument?
- Im developing both a KPart and a standalone application, how do I avoid duplicated code?