Results 1 to 8 of 8

Thread: [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

  1. #1
    Join Date
    Mar 2009
    Posts
    14
    Thanked 2 Times in 2 Posts

    Default [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

    I'm a Linux newbie. QT Creator 1.0.0 (Qt 4.5) worked fine for Vista and OS X. Under Centos 5.2 I must be missing something.

    /home/esutton/qtsdk-2009.01/qt/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
    collect2: ld returned 1 exit status

    My best guess is libQtGui has a dependency on Fonconfig. I have fonconfig and fonconfig-devel 2.4.1.7. I could not find any newer RPMs for Centos. I tried downloaded the 2.6 tarball and configure,make, and make install without success. What else may I be missing?

    Thanks in advance for any direction,

    -Ed

  2. #2
    Join Date
    Mar 2009
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

    CentOS 5.2 + Qt 4.5 + FcFeeTypeQueryFace

    --mgbowman (aka theitdepartment)
    Last edited by mgbowman; 15th March 2009 at 20:35.

  3. The following user says thank you to mgbowman for this useful post:

    perden (30th March 2009)

  4. #3
    Join Date
    Mar 2009
    Posts
    14
    Thanked 2 Times in 2 Posts

    Smile Re: [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

    Thank you *very* much for posting the link to your blog!

    http://theitdepartment.wordpress.com/2009/03/

    This was the perfect solution and step-by-step guide needed by a newbie like myself to solve this problem and get me going with QT. I can now build and run my QT Creator "hello world" app under Centos 5.2!

    Thanks again for your assistance,

    -Ed

  5. #4
    Join Date
    Mar 2009
    Posts
    14
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

    Quote Originally Posted by mgbowman View Post
    CentOS 5.2 + Qt 4.5 + FcFeeTypeQueryFace

    --mgbowman (aka theitdepartment)
    Any chance we can get an abridged version here? My company blocks wordpress.

  6. #5
    Join Date
    Mar 2009
    Posts
    14
    Thanked 2 Times in 2 Posts

    Default Re: [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

    Use an anonymous browser to defeat the evil IT Overlords.
    http://www.the-cloak.com

    Copied from:
    http://theitdepartment.wordpress.com/2009/03/

    Archive for March, 2009
    CentOS 5.2 + Qt 4.5 + FcFreeTypeQueryFace


    Posted by theitdepartment on March 15, 2009

    So with all the buzz around the new release of Qt 4.5, you may be like me and have been desperately wanting to give it a whirl. Has this happened to you yet?

    /opt/qtsdk-2009.01/qt/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
    collect2: ld returned 1 exit status

    Someone’s got some ’splainin to do. Lucky for you, that’s me. Basically, the people at fontconfig did not add this API call until 2.4.2. From fontconfig’s ChangeLog 2.4.2:

    commit 72ffe6536a6825a32095c8185aff836a12326ac5
    Author: Keith Packard
    Date: Sat Dec 2 13:22:27 2006 -0800

    Add FcFreeTypeQueryFace external API. Bug #7311.

    Expose ability to build an FcPattern directly from an FT_Face
    object.

    configure.in | 4 ++--
    doc/fcfreetype.fncs | 17 +++++++++++++++-
    fontconfig/fcfreetype.h | 6 ++++++
    src/fcfreetype.c | 50 ++++++++++++++++++++++++++---------------------
    4 files changed, 52 insertions(+), 25 deletions(-)

    Problem is for us CentOS 5.2 users, we’re given a version 2.4.1-7 from “upstream” It’s not a big deal, we can just compile fontconfig from source … wait, did I just say compile? No worries, it’s easy.

    1. Compile fontconfig 2.4.2 from source

    Note: Throughout this step, I used fontconfig 2.4.2 since this is the minimum required version, but I tested this with the latest version 2.6.0 so just replace the version numbers accordingly if you choose to use 2.6.0.

    [user@localhost ~]$ cd /usr/src
    [user@localhost /usr/src]$ wget http://fontconfig.org/release/fontconfig-2.4.2.tar.gz
    [user@localhost /usr/src]$ tar -zxf fontconfig-2.4.2.tar.gz
    [user@localhost /usr/src]$ cd fontconfig-2.4.2
    [user@localhost /usr/src/fontconfig-2.4.2]$ ./configure –prefix=/opt/fontconfig-2.4.2
    … (note: ‘configure’ output omitted for brevity) …
    [user@localhost /usr/src/fontconfig-2.4.2]$ make
    … (note: ‘make’ output omitted for brevity) …
    [user@localhost /usr/src/fontconfig-2.4.2]$ make install
    … (note: ‘make install’ output omitted for brevity) …

    Note: I chose to install into /opt/fontconfig-2.4.2 since I like keeping my “deviations” from upstream organized.

    2. Add the fontconfig library location to your project’s .pro file

    LIBS += -L/opt/fontconfig-2.4.2/lib

    3. Recompile and that’s it! 8-)

    Now I can’t guarantee you will not have any ‘make’ errors due to library dependencies but I’m pretty sure that if you got as far as you did to receive this error, you will have every *-devel package needed by fontconfig already installed on your system.

  7. The following user says thank you to esutton for this useful post:

    perden (30th March 2009)

  8. #6
    Join Date
    Mar 2009
    Posts
    14
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

    Thanks, this was the eureka that I needed to figure out my problem:

    Using RHEL5, I downloaded and installed the qt-sdk-linux-x86-opensource-2009.01.bin with no problem, but nothing would build. I figured I needed a new version of fontconfig as RHEL5 is getting old now, so I downloaded, compiled, and installed fontconfig-2.6.0. Yet after the install it still wouldn't work! I posted here to get some inspiration, and after reading mgbowman's material copied by esutton, I decided to check where libQtGui.so was actually pulling the library from:

    $ ldd ~/opt/qtsdk-2009.01/lib/libQtGui.so.4
    (...)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb7197000)
    (...)


    Apparently the Qt binary installer doesn't actually search for any of the linked libraries. It assumes that they are in /usr/lib from when Qt was originally built. Reconfiguring fontconfig with --prefix=/usr to adjust the install location did the trick.

  9. #7
    Join Date
    Mar 2009
    Posts
    14
    Thanked 2 Times in 2 Posts

    Default Re: [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

    Thank you very much for explaining the true cause of the problem and sharing your Eureka moment. Including LIBS += -L/opt/fontconfig-2.4.2/lib in all my QT project files was a silly solution.

    libQtGui.so expects to find libfontconfig.so.1 located at: /usr/lib/libfontconfig.so.1 resulting in the following error:

    /home/esutton/qtsdk-2009.01/qt/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
    collect2: ld returned 1 exit status

    Solution

    1. cd /usr/src
    2. wget http://fontconfig.org/release/fontconfig-2.4.2.tar.gz
    3. tar -zxf fontconfig-2.4.2.tar.gz
    4. cd fontconfig-2.4.2
    5. ./configure -prefix=/usr
    6. make
    7. make install

  10. #8
    Join Date
    Nov 2009
    Location
    Gdańsk - Poland
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [CentOs 5.2] How fix libQtGui.so undefined reference FcFreeTypeQueryFace?

    I found another solution. The problematic package is fontconfig-devel. After uninstalling it, QT compiles just fine.
    System: Red Hat Enterprise 5.4 Kernel 2.6.18-164.6.1.el5 on an x86_64
    fontconfig-2.4.1-7.el5 (.i386 and x86_64)

    Don't know if I need that devel, but I couldn't install fontconfig-2.4.2 (I'm quite new in Linux).

Similar Threads

  1. Unable to install QT 4.4.0 from sources
    By debnathm in forum Installation and Deployment
    Replies: 4
    Last Post: 6th August 2008, 07:43
  2. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 18:33
  3. MS Sql native driver??
    By LordQt in forum Qt Programming
    Replies: 4
    Last Post: 9th October 2007, 14:41
  4. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 15:28
  5. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 20:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.