Merging of kdelibs_export.h and kdelibs_export_win.h

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Tue Jan 23 22:34:29 CET 2007


Jacob R Rideout schrieb:
>> > yesterday this change was made to kdelibs_export.h:
>> > -#define KSPELL2_EXPORT KDE_EXPORT
>> > +#define SONNET_EXPORT KDE_EXPORT
>> >
>> And this is still wrong!
>> ->
>> kde4_add_library(sonnetcore SHARED ${sonnetbase_STAT_SRCS})
>> so it must be MAKE_SONNETCORE_LIB
>>
>> once more recompiling whole kdelibs (but this time for win32 only) :(
>>
> 
> Could someone explain the error to me, so that I don't mess up the build
> again.
> 
I'll try. Don't we have a wiki page for this already? If not we should
create one.

On Windows you need to export your functions in a shared lib to allow
access to those functions from outside. At this point it's the same like
gcc's visibility support. The main difference is, that if you want to
use such an exported function, you need to decorate them in another way.
This means that you have to define FOO_EXPORT depending on what you want do:

#ifdef MAKE_SONNETCORE_LIB
// here we build the lib
# define SONNETCORE_EXPORT KDE_EXPORT
#else
// here we use the lib
# define SONNETCORE_EXPORT KDE_IMPORT
#endif

MAKE_FOO_LIB is automatically defined when you use kde4_add_library(foo
...).


Please ask if there is something unclear - I'm not very good in
explaining things in an understandable way :)

Christian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20070123/96c3f862/attachment.pgp 


More information about the Kde-buildsystem mailing list