Disabling -fvisibility for kdewidgets and styles

Karl Vogel karl.vogel at telenet.be
Sun Nov 21 00:49:32 GMT 2004

Unai Garro <ugarro at telefonica.net> writes:

> After so much mess trying to fix the kde build I found what the problem
> was. It seems kdelibs/kdewidgets and styles are built with
> -fvisibility=hidden, and that breaks the plugin loading by Qt. Due to
> that kdebase won't build either, since the configure script won't find
> the kdewidget plugins for uic.
> I disabled the flag for kdewidget just adding -fvisibility=default, and
> now my kdebase seems to be building just fine. I could not do this by
> any other means than hacking into the generated Makefile.
> Could this be made the default behaviour for Qt plugins like widgets and
> styles?

Back when I had my QT converted to use the -fvisibility=hidden, I remember
that I had to add a patch to a QT header... my notes from back then:

qgplugin.h :
* Q_EXPORT_PLUGIN needs attribute to export style plugins

Looking at my old sources, I have the following in qgplugin.h (notice
the visibility attributes):

#    else
#       define Q_EXPORT_PLUGIN(PLUGIN) \
            Q_EXTERN_C __attribute__((visibility ("default"))) \
            const char *qt_ucm_query_verification_data() \
            { return qt_ucm_verification_data; } \
            Q_EXTERN_C __attribute__((visibility ("default"))) QUnknownInterface* ucm_instantiate() \
#    endif

Some style plugins use the Q_EXPORT_PLUGIN() macro, which isn't
exporting the symbol if used with -fvisibility=hidden

NOTE: my file is from 24 July.. so this information might not be
valid anymore. Caveat Emptor.

More information about the kde-core-devel mailing list