[Kde-games-devel] What defines __KDE_HAVE_GCC_VISIBILITY? was: Build system changes: new library libkdegamesprivate

Albert Astals Cid aacid at kde.org
Tue May 22 21:06:01 UTC 2012


El Dimarts, 22 de maig de 2012, a les 16:12:46, Ian Wadham va escriure:
> On 22/05/2012, at 4:01 AM, Albert Astals Cid wrote:
> > El Dissabte, 19 de maig de 2012, a les 14:13:41, Ian Wadham va escriure:
> >> 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?
> > 
> > __KDE_HAVE_GCC_VISIBILITY is defined by kdemacros.h that originates from
> > kdelibs
> 
> Errmmmm, no.  That was exactly my problem … __KDE_HAVE_GCC_VISIBILITY
> not defined, null KDE_EXPORT, null KDEGAMES_EXPORT, no external links to
> libkdegames ... no build.
> 
> __KDE_HAVE_GCC_VISIBILITY is *referenced* in kdemacros.h but it is not
> defined there, nor can I find it in any other kdelibs include-file. 

It is defined there, but only if the check in FindKDE4Internal.cmake when 
compiling kdelibs succeeds.

Did you compile your own kdelibs or someone else did?

Albert

> However, after much further probing, I have found
> <prefix>/share/apps/cmake/modules/FindKDE4Internal.cmake, which appears to
> define __KDE_HAVE_GCC_VISIBILITY … phew, puff, puff …
> 
> So now I know the part of KDE to file a bug report and have done so.
> 
> Cheers, Ian W.
> 
> 
> 
> 
> 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