[Kde-games-devel] What defines __KDE_HAVE_GCC_VISIBILITY? was: Build system changes: new library libkdegamesprivate
Albert Astals Cid
aacid at kde.org
Mon May 21 18:01:06 UTC 2012
El Dissabte, 19 de maig de 2012, a les 14:13:41, Ian Wadham va escriure:
> On 13/05/2012, at 6:58 AM, Stefan Majewsky wrote:
> > On Sun, May 6, 2012 at 6:55 AM, Ian Wadham <iandw.au at gmail.com> wrote:
> >> I am seriously held up by this and that means that Avnee and Roney will
> >> soon be held up, too.
> >
> > Fixed now?
>
> No, it *was* not. And I have just lost two more days … :-( However, I have
> beaten the build into submission and now I am compiling and building on
> Apple again.
>
> The problem was that the macros KDEGAMES_EXPORT and KDE_EXPORT
> evaluated to null strings in my system. Consequently, although libkdegames
> would compile and build, none of the symbols were visible to any of the
> games programs or dependent libraries, so I was continually getting
> undefined symbols when linking.
>
> KDE_EXPORT is defined in <prefix>/include/kdemacros.h by:
>
> #ifdef __KDE_HAVE_GCC_VISIBILITY
> #define KDE_NO_EXPORT __attribute__ ((visibility("hidden")))
> #define KDE_EXPORT __attribute__ ((visibility("default")))
> #define KDE_IMPORT __attribute__ ((visibility("default")))
> #elif defined(_WIN32) || defined(_WIN64)
> #define KDE_NO_EXPORT
> #define KDE_EXPORT __declspec(dllexport)
> #define KDE_IMPORT __declspec(dllimport)
> #else
> #define KDE_NO_EXPORT
> #define KDE_EXPORT
> #define KDE_IMPORT
> #endif
>
> Somehow __KDE_HAVE_GCC_VISIBILITY was not defined in my system, although
> __GNUC__ evaluates to 4. So where, in KDE, is __KDE_HAVE_GCC_VISIBILITY
> defined (it is not in kdemacros.h)? And, if there is neither GCC visibility
> nor Windows, should not KDE_EXPORT evaluate to some sensible default or
> something uncompileable?
>
> My "fix" has been to use "add_definitions (-D__KDE_HAVE_GCC_VISIBILITY)" in
> kdegames/CMakeLists.txt, but that is obviously not portable.
>
> Any ideas?
__KDE_HAVE_GCC_VISIBILITY is defined by kdemacros.h that originates from
kdelibs
Albert
>
> Cheers, Ian W.
> _______________________________________________
> kde-games-devel mailing list
> kde-games-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-games-devel
More information about the kde-games-devel
mailing list