PDA

View Full Version : Installed Qt SDK in Linux, errors building examples



Compeau
11th May 2010, 17:12
I installed the Qt SDK for Linux/X11 32-bit on a system using Red Hat Enterprise Linux 5. When I try to build some of the simple examples in Qt Creator, I get errors. Here is the error I get when I attempt to build the SDI example:


g++ -Wl,-rpath,/home/user/qtsdk-2010.02/qt/lib -o sdi main.o mainwindow.o moc_mainwindow.o qrc_sdi.o -L/home/user/qtsdk-2010.02/qt/lib -lQtGui -L/home/user/qtsdk-2010.02/qt/lib -L/usr/X11R6/lib -lQtCore -lpthread
/home/user/qtsdk-2010.02/qt/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
collect2: ld returned 1 exit status
make: Leaving directory `/home/user/qtsdk-2010.02/qt/examples/mainwindows/sdi'
make: *** [sdi] Error 1
Exited with code 2.
Error while building project sdi
When executing build step 'Make'

Any idea what the cause of these errors are? Any help would be greatly appreciated.

Lykurg
11th May 2010, 17:18
Have a look at the requirements for Qt on X11: http://doc.trolltech.com/4.6/requirements-x11.html. Seems you are missing Free Type.

Compeau
11th May 2010, 18:12
I had an older version of FreeType installed in /usr/local, but thinking that maybe Qt4 needed a newer version, I downloaded and built the latest version of FreeType, and installed it in the same location (/usr/local). This does not fix the problem, I get the same error. here is the version of FreeType I have installed:

[user@localhost ~]$ freetype-config --version
10.0.4
[user@localhost ~]$ freetype-config --ftversion
2.3.12

Could this be an environment variable issue, or Qt4 looking in another path for FreeType?

Compeau
11th May 2010, 19:41
Do I need to build qmake? The qmake executable already exists in the sdk. I just don't know what I need to do to get Qt working for me.

norobro
11th May 2010, 20:29
On my Debian system 'FcFreeTypeQueryFace' is defined in fcfreetype.h which is in the development package of libfontconfig1. The Debian package name is "libfontconfig1-dev". Do you have all of the recommended dev packages installed as per Lykurg's link?

Compeau
12th May 2010, 20:54
On my Debian system 'FcFreeTypeQueryFace' is defined in fcfreetype.h which is in the development package of libfontconfig1. The Debian package name is "libfontconfig1-dev". Do you have all of the recommended dev packages installed as per Lykurg's link?

Ok, I got it working. For some reason the version of FontConfig installed on my system wasn't working with Qt (either because it was a too-old version, or it was installed in a location that Qt didn't look at). I installed the source for the latest version of FontConfig and built it, and now I can compile and run Qt projects.