QT for linux 的错误 undefined reference to 'FcFreeTypeQueryFace' 的解决方法

来源:互联网 发布:四川电视台网络电视 编辑:程序博客网 时间:2024/05/22 04:58

下载了qt-sdk-linux-x86-opensource-2009.03.bin,在CentOS5.3下安装后,可以正常启动qt creator了。编写自己写的例子的时却发现链接有错误:p, li { white-space: pre-wrap;

/opt/qtsdk-2009.03/qt/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'

collect2: ld 返回 1

make: *** [threadWidget] 错误 1

make: Leaving directory `/root/Desktop/090914/threadWidget'

Exited with code 2.

Error while building project threadWidget

When executing build step 'Make'


经搜索,跟fontconfig的版本有关系,CentOS上的是2.4.1,据说要2.4.2以上版本才可以。不过我直接从 http://www.fontconfig.org/release/ 下载最新的2.6.0的源码。

 

解开后按照INSTALL文件里的说明安装了fontconfig,然后就可以正常编译程序啦:

  1. 进入解开的fontconfig目录,可以看到INSTALL文件等
  2. ./configure --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man
  3. make
  4. make install
原创粉丝点击