[Digikam-devel] digikam libs questions

Patrick Spendrin ps_ml at gmx.de
Sat Oct 25 14:26:12 BST 2008


Andi Clemens schrieb:
> Gilles asked me to send this mail to the ML...
> 
> 
> Hi,
> 
> I used to program in python all the time, so I'm still quite confused by the 
> libs mechanism in C++.
> 
> I understand that some of the .o files are packed into library files (to save 
> space and make things easier) and some header files are stored 
> in /usr/include/digikam to actually access those libs from the program the 
> libs will be used in.
> 
> But what are those DIGIKAM_EXPORT macros for? They seem to be in nearly every 
> class although not every class seems to be exported into libs (or at least no 
> header files exist in /usr/include/digikam).
Exactly. Basically you need one export macro (like DIGIKAM_EXPORT) for 
each library you build in the end. The export macro gets set in 
digikam/digikam/digikam_export.h to KDE_EXPORT or KDE_IMPORT. The idea 
is to restrict the API you expose to the library user by these 
functions. They are especially important under Windows, but the current 
g++ compilers support visibility as well.
> 
> Do they signal gcc to pack those object files into libraries?
> I found out that in the main CMakeLists.txt (in digikam root) there are a lot 
> of libs defined, but in the end only a few of them are actually installed 
> in /usr/lib. For example we define a libhaar, but I can't find it anywhere.
> 
> Maybe those questions are stupid, but I want to understand completely what we 
> are doing here (in Cmake and in the code as well).
> For example my histogrambox widget: I just used copy and paste for it, because 
> I didn't know what to do at this moment. So it has an EXPORT macro in front 
> of the class and it also becomes installed in /usr/include, but I guess we 
> don't need this widget the be accessed from outside of digiKam. So I could 
> remove it from the INSTALL rule in the CMake file. But if I do so, do I have 
> to remove the EXPORT macro as well or do I have to keep it.
yes, of course.
> 
> 
> Andi
regards,
Patrick

p.s.: if you need a complete explanation of this issue just ask me.
> _______________________________________________
> Digikam-devel mailing list
> Digikam-devel at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-devel
> 


-- 
web:                 http://windows.kde.org
mailing list:        kde-windows at kde.org
irc:                 #kde-windows (irc.freenode.net)



More information about the Digikam-devel mailing list