Ubuntu8.04 下安装 QT for X11 4.4.0

来源:互联网 发布:电子商务php 编辑:程序博客网 时间:2024/04/29 01:54

      从Trolltech网站下载相应的软件开源包,解压在oren用户的目录下。

      首先要安装xorg-dev开发包,否则configure之后会出现下面警告信息:
       【NOTICE: Qt will not be built with XShape support.
       As a result, drag-and-drop in the Qt Designer will NOT
       work. We recommend that you enable XShape support by passing
       the -xshape switch to ./configure.】

      执行./configure
      其次要安装 libx11-dev 、libxext-dev开发包,否则就会出现“X11/Xlib.h / libxext.h : 没有该文件或目录”的错误信息:
        执行make (在虚拟己上约需3-4个小时)
        执行sudo make install(或su –c “make install”)
 
      通过gedit .profile 编辑 ~/.profile,把下面一行代码添加到 ~/.profile文件中,
      export PATH=/usr/local/Trolltech/Qt-4.4.0/bin:$PATH
      source ~/.profile
                               
      最后我们来测试一下:
      # qtdemo
      或者
      # assistant
 
       如果要想编译出qvfb,必须在make后,进入tools/qvfb子目录下再次make,最后会在bin目录下生成qvfb程序。
       【注】我在编译的时候,由于缺少ui_config.h文件而不能生成qvfb;经分析qvfb/makefile文件,手工执行下面命令后才可以(但没有明白到底因为什么):
       ../../bin/uic config.ui –o ui_config.h