Qt 经典出错信息之”Basic XLib functionality test failed...

此完整出错信息是在./configure阶段
Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/zhu/Qt/qt-x11-opensource-src-4.5.2/mkspecs/linux-g++

还是老办法,以不变应万变。进config.test / x11/xlib 执行make命令,看出错信息
g++ -Wl,-O1 -o xlib xlib.o    -L/usr/X11R6/lib -lXext -lX11 -lm
/usr/bin/ld: cannot find -lXext
看到了吧,g++在/usr/X11R6/lib下,找不到libXext.so呢。

其原因就在于需要安装libX11的开发包,在ubuntu/debian里包名都是libX11-dev
根据以往的经验,在./configure前主动装好下面3个包,基本上就万事大吉了
sudo apt-get install libX11-dev libXext-dev libXtst-dev


执行上面的命令如果出错,需要更新sudo gedit /etc/apt/sources.list

#网易的源(速度很快)
deb http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
#ubuntu
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
# Ubuntu官方提供的其他软件(第三方闭源软件等):
deb http://archive.canonical.com/ubuntu/ precise partner
deb http://extras.ubuntu.com/ubuntu/ precise main

最后sudo apt-get update就可以了

你可能感兴趣的:(Qt 经典出错信息之”Basic XLib functionality test failed...)