红联Linux门户
Linux帮助
当前位置: 红联Linux门户 > Ubuntu

在ubunt7.1上编译qt遇到的小麻烦

发布时间:2008-02-13 00:10:44来源:红联作者:auhtcode
我的系统是ubuntu7.1,由于我的更新源里qt的版本是4.3.2,而我向安装最新版的4.3.3,然后就下载了
qt=x11-opensource-src-4.3.3,想从源代码开始进行编译安装,./configure顺利通过,可是在make的时候却出现了下面的错误:
./src/gui/kernel/qt_x11_p.h:64:22: 错误: X11/Xlib.h:No such file or directory
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:69:23: 错误: X11/Xutil.h:No such file or directory
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:70:21: 错误: X11/Xos.h:No such file or directory
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:77:23: 错误: X11/Xatom.h:No such file or directory
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:262: 错误: ‘Colormap’ 没有命名一个类型
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:263: 错误: ISO C++ 不允许声明无类型的 ‘Visual’
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:263: 错误: expected ‘;’ before ‘*’ token
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:272: 错误: ‘Time’ 没有命名一个类型
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:273: 错误: ‘Window’ 没有命名一个类型
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:274: 错误: ‘Window’ 没有命名一个类型
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:297: 错误: ‘Window’ 没有命名一个类型
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:300: 错误: ‘Window’ 未声明
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:301: 错误: ‘Window’ 未声明
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:301: 错误: ‘Atom’ 未声明
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:302: 错误: ‘Atom’ 未声明
../../include/QtGui/private/../../../src/gui/kernel/qt_x11_p.h:303: 错误: ‘Window’ 未声明

后来在论坛里搜索说是
说需要安装几个包:
sudo apt-get install libx11-dev
sudo apt-get install xlibs-dev
sudo apt-get install libghc6-x11-dev
sudo apt-get install libooc-x11-dev
但是我的原里没有

然后就在http://packages.ubuntu.com/这个网站里搜索我要下载的包,搜到以后,我去寻找他的下载连接的网站是否提供更新源,添加上之后,完成更新,重新make,通过。

另外qt安装完后,还需要设置相应的环境变量,参见的文档install
文章评论

共有 1 条评论

  1. szzfq61 于 2008-12-19 15:40:25发表:

    more :
    when I update the following libs (sudo apt-get install xlibs-dev
    sudo apt-get install libooc-x11-dev ), i can't be success.

    search information by internet,and found :
    the command (sudo apt-get install xlibs-static-dev)
    can't install ,either, but OS output the info : 'x11protoxx-dev ... can replace it',
    so , i tried the command:sudo apt-get install x11protoxx-dev
    updating........,passed !

    then next steps are 'make','make install',
    go to the path ../qt/bin/ ,entry './designer' .QT design UI come out.