fatal error if KDE compiles with hidden visibility but Q_DECL_EXPORT is defined to nothing

Andreas Pakulat apaku at gmx.de
Thu Jun 21 15:09:19 CEST 2007


On 21.06.07 14:18:03, Thiago Macieira wrote:
> 
> Matthias Kretz said:
> > Hi,
> >
> > as I just got my second report that phonon doesn't link I thought I'd
> > better
> > implement a check that errors out if Qt has been compiled without
> > visibility
> > support but KDE is compiled with default hidden visibility.
> >
> > This is necessary for
> > 1. phonon which uses Q_DECL_EXPORT as export macro
> > 2. all plugins that export their entry symbols using Q_DECL_EXPORT or any
> > other macro that uses Q_DECL_EXPORT
> >
> > Ok, to commit the attached patch?
> 
> It's much easier and even probably better to define KDE_EXPORT as
> Q_DECL_EXPORT (similarly for KDE_IMPORT).
> 
> The reason we don't do that is because qglobal.h cannot be included from C
> source files -- though IMHO it should.

Unless I'm overlooking something that will break. I just recently fixed
phonone which used

if MAKE_PHONON_LIB
  define PHONON_EXPORT Q_DECL_EXPORT
else
  define PHONON_EXPORT Q_DECL_IMPORT
endif

and while this works on Win32, it breaks on linux because Q_DECL_EXPORT
doesn't evaluate to default-visibility (don't know the gcc command for
that) but to nothing. At least on a "default-built" qt-copy. 

> 2) No C source file can export symbols, period. We don't produce C
> libraries in KDE. However, unmangled symbols can easily be exported from
> C++ source files by using extern "C".

Thats far better solution IMHO.

Andreas

-- 
Don't Worry, Be Happy.
		-- Meher Baba


More information about the Kde-buildsystem mailing list