The configure script of kdelibs-3.5.5-r7 always says that -fvisibility support in qt-4.1.4-r2 is disabled (even if it is enabled). Due to this bug, -fvisibility support in kdelibs-3.5.5-r7 is only enabled when using qt-3, but is disabled with qt-4. config.log contains: > configure:36301: checking if Qt is patched for -fvisibility > configure:36348: i686-pc-linux-gnu-g++ -c -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -O2 -march=prescott -pipe -msse3 -mfpmath=sse -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -I${prefix}/include -I/usr/qt/3/include -I. -DQT_THREAD_SUPPORT -D_REENTRANT conftest.cpp >&5 > configure:36354: $? = 0 > configure:36379: result: no The cause for this is kdelibs-3.5.5/admin/acinclude.m4.in, around line 3443. The code there checks for the availability of the Q_EXPORT macro. This macro is defined in qt-3.x, but not in qt-4.1.4-r2, so the check does not work as intended. In my opinion, checking for the 'reduce_exports' flag in QT_CONFIG (set via qconfig.pri in the Qt mkspecs directory) should work for at least qt-4.1.4-r2. This does not look like a Gentoo-only bug to me, but I have not yet reported it upstream. Perhaps you should do that. I suggest providing a fix in Gentoo until upstream has a better one. This bug may be the real cause for Gentoo bug 141781.
KDE 3.x does *NOT* use Qt 4!