由于需要基于Centos下调用Qt的webkit来进行web相关的开发工作,所以需要对Qt进行源码编译,再编译出对应的webkit相关的库来。

在编译的过程中,遇到了一些坑,特此记录一下。

Qt源码编译过程:

  1. 下载Qt源码
  2. 先检查配置:

./configure

2.1 检查配置报错:

Creating qmake...gmake: Nothing to be done for `first'.Running configuration tests...The test for linking against libxcb and support libraries failed! You might need to install dependency packages, or pass -qt-xcb. See src/plugins/platforms/xcb/README.

看到这个报错后,第一时间就是百度查,经过了很长时间,百度翻了个遍也没找到。
回过头来,发现这个报错信息其实已经很明确了,指明遇到问题时查看See src/plugins/platforms/xcb/README。仔细读一下这个Readme,里面已经指明了需要安装的依赖项。唉,总是犯这种低级的老毛病。然后安装上相关的依赖:

Requires libxcb >= 1.5.PACKAGE DEPENDENCIESRequired packages:libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm1 libxcb-icccm1-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-devOn Ubuntu 11.10 icccm1 is replaced by icccm4 and xcb-render-util is not available:libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-devThe packages for xcb-render-util can be installed manually from http://packages.ubuntu.com/natty/libxcb-render-util0 and http://packages.ubuntu.com/natty/libxcb-render-util0-devOn Ubuntu 12.04 icccm1 is replaced by icccm4 and xcb-render-util can be installed automatically:libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-devOn Fedora, the following packages are required:libxcb libxcb-devel libXrender libXrender-devel xcb-util-wm xcb-util-wm-devel xcb-util xcb-util-devel xcb-util-image xcb-util-image-devel xcb-util-keysyms xcb-util-keysyms-develREDUCING RUNTIME DEPENDENCIESThe '-qt-xcb' configure option can be used to get rid of most xcb- dependencies. Only libxcb willstill be linked dynamically, since it will be most likely be pulled in via other dependencies anyway.This should allow for binaries that are portable across most modern Linux distributions.

2.2 安装ICU

yum install icu.x86_64yum install libicu-devel.x86_64

2.3 安装OpenSSL

yum install openssl-devel.x86_64 
  1. 开始编译:

make -j8

  1. 开始安装:

make install

QtWebkit编译过程:

  1. 安装依赖
    1.1 安装perl相关包
    yum install perl-*
    1.2 安装gperf相关包
    yum install gperf.x86_64
    1.3 安装ruby相关包
    yum install ruby.x86_64
  2. 编译webkit
    ./qtwebkit/Tools/Scripts/build-webkit --qt --debug
©著作权归作者所有:来自51CTO博客作者XDATAPLUS的原创作品,如需转载,请注明出处,否则将追究法律责任

好知识,才能预见未来

赞赏

0人进行了赞赏支持

更多相关文章

  1. 源码编译搭建LAMP架构
  2. 详解TensorFlow™ GPU 安装
  3. clickhouse安装配置
  4. Docker容器--安装部署
  5. MySQL 8.0 安装教程 步骤 (windows 64位)
  6. WebAssembly入门课
  7. Nginx之_源码编译安装
  8. 软件包管理
  9. Django链接mysql数据库

随机推荐

  1. Hive中使用Python实现Transform时遇到Bro
  2. python学习笔记(3)--爬虫基础教程1
  3. 在NumPy中更改数组边缘的值
  4. 学习用pyhon写hive udf
  5. 创建单独的函数而不是一个大的缓慢处理时
  6. python打印系统所有tcp,udp监听端口及服
  7. python学习(13)————jieba进阶生成词云
  8. 用于搜索和替换大字符串的最快Python方法
  9. 基于scrapy框架的关于58同城招聘网站信息
  10. PyQt中的各种提示框