Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Im developing both a KPart and a standalone application, how do I avoid duplicated code?

0
10 Posted

Im developing both a KPart and a standalone application, how do I avoid duplicated code?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.