You are not logged in.

1

Saturday, January 12th 2008, 11:53am

KDE4 build problems with Qt4

Hi. I try to build KDE4 from source code on Linux (x86_64), but when I build kdelibs I get a cmake error message

Source code

1
2
CMake Error: Qt compiled without support for -fvisibility=hidden. 
This will break plugins and linking of some applications. Please fix your Qt installation.

I have Qt 4.3.3 built with -fvisibility=default. But when I try to build Qt with -fvisibility=hidden it fails with many "undefined reference to" errors while linking /bin/uic3 target. That's the example:

Source code

1
2
3
4
5
6
7
Entering directory `/usr/src/apps/qt-x11-opensource-src-4.3.3/src/tools/uic3'
g++ -m64 -fno-exceptions -Wl,-rpath,/usr/lib64 -Wl,-rpath,/usr/lib64 -o ../../../bin/uic3 .obj/release-shared/customwidgetsinfo.o .obj/release-shared/databaseinfo.o .obj/release-shared/driver.o .obj/release-shared/treewalker.o .obj/release-shared/ui4.o .obj/release-shared/uic.o .obj/release-shared/validator.o .obj/release-shared/cppextractimages.o .obj/release-shared/cppwritedeclaration.o .obj/release-shared/cppwriteicondata.o .obj/release-shared/cppwriteicondeclaration.o .obj/release-shared/cppwriteiconinitialization.o .obj/release-shared/cppwriteincludes.o .obj/release-shared/cppwriteinitialization.o .obj/release-shared/main.o .obj/release-shared/ui3reader.o .obj/release-shared/parser.o .obj/release-shared/domtool.o .obj/release-shared/object.o .obj/release-shared/subclassing.o .obj/release-shared/form.o .obj/release-shared/converter.o .obj/release-shared/widgetinfo.o .obj/release-shared/embed.o .obj/release-shared/qt3to4.o .obj/release-shared/deps.o    -L/usr/src/apps/qt-x11-opensource-src-4.3.3/lib -lQt3Support -L/usr/src/apps/qt-x11-opensource-src-4.3.3/lib -lQtSql -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -L/usr/X11R6/lib64 -pthread -pthread -pthread -pthread -lQtNetwork -pthread -pthread -pthread -pthread -pthread -pthread -lQtXml -pthread -pthread -lQtGui -lpng -lSM -lICE -pthread -pthread -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
.obj/release-shared/ui4.o: In function `DomChar::write(QDomDocument&, QString const&) const':
/usr/src/apps/qt-x11-opensource-src-4.3.3/src/tools/uic3/../uic/ui4.cpp:5628: undefined reference to `QDomDocument::createElement(QString const&)'
/usr/src/apps/qt-x11-opensource-src-4.3.3/src/tools/uic3/../uic/ui4.cpp:5630: undefined reference to `QDomElement::QDomElement()'
/usr/src/apps/qt-x11-opensource-src-4.3.3/src/tools/uic3/../uic/ui4.cpp:5639: undefined reference to `QDomDocument::createTextNode(QString const&)'
...

Please help me. I really don't know what to do next and what's the problem is...

2

Monday, April 7th 2008, 8:17am

there is a hidden configure-option for QT

just add the following option to your QT-configure:
-reduce-exports

sadly, this option is not listed in the --help output from the configure-script.

good byte

3

Friday, April 11th 2008, 7:13am

just come to have a look
offer something special:
http://www.cntradecity.com/product.asp?Classid=50&Nclassid=293

4

Friday, April 11th 2008, 6:04pm

Oh, I just completely forgot to write here about results.. My problem was somewhere in the toolchain: I used GCC 4.2 as I remember, and it compiled something weird. I don't think it was a compiler itself, but the whole toolchain. I've recompiled the toolchain and changed GCC to 4.1.2 to ensure and that was it.

Now I use KDE 4.0.3 and it's something wonderful. Thank everyone for support.

5

Saturday, April 12th 2008, 9:15pm

i had the same error message about -fvisibility=hidden with gcc-4.1.2 and worked around with the undocumented configure-switch "-reduce-exports" for QT4.

(just to make clear that this error does not always come from a bad tool chain)

good byte