解决qt5.12.12编译源码没有libqxcb的问题

最近要研究一下qt源码,因为设计到要修改源码,所以需要编译源码并替换修改的库文件运行验证。

我这里使用的是qt5.12.12版本,去官网上下载对应版本的安装包,安装时勾选上源码即可。

后面编译完发现,plugins/platforms/目录下没有生成库文件libqxcb.so,造成了一点麻烦。

        设置 export QT_DEBUG_PLUGINS=1 
        大概的提示是 qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "xxx" even though it was found.

下面记录一下,我使用的解决方法

1. 在编译前会执行configure脚本,后面要加-xcb参数,如下

        ./configure -prefix /opt/build  -opensource -confirm-license  -skip qtlocation  -nomake examples   -nomake tests -xcb

2. 直接执行configure可能会报错,此时安装xcb需要的一些库

        sudo apt update
        sudo apt-get install libdrm-dev libxcomposite-dev libxcursor-dev libxi-dev libxtst-dev

        //这几个都搞成yes
        Required system libraries for qpa-xcb:
        x11 .................................. yes
        libdrm ............................... yes
        xcomposite ........................... yes
        xcursor .............................. yes
        xi ................................... yes
        xtst ................................. yes

3. make、 make install

相关推荐

  1. 解决qt5.12.12编译没有libqxcb问题

    2024-05-12 09:12:09       14 阅读
  2. qt5.12版本交叉编译错误

    2024-05-12 09:12:09       13 阅读
  3. 解决没有进入docker权限问题

    2024-05-12 09:12:09       36 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-05-12 09:12:09       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-05-12 09:12:09       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-05-12 09:12:09       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-05-12 09:12:09       18 阅读

热门阅读

  1. Lua 协程模拟 Golang 的 go defer 编程模式

    2024-05-12 09:12:09       11 阅读
  2. 您真的会高效使用 Mac 吗?

    2024-05-12 09:12:09       9 阅读
  3. git 命令 - rebase

    2024-05-12 09:12:09       9 阅读
  4. leetcode234-Palindrome Linked List

    2024-05-12 09:12:09       10 阅读
  5. 【C++】list的使用

    2024-05-12 09:12:09       9 阅读
  6. C语言星号带括号的情形

    2024-05-12 09:12:09       10 阅读
  7. 树(Tree)和二叉树

    2024-05-12 09:12:09       10 阅读
  8. Qt中正则表达式的用法

    2024-05-12 09:12:09       10 阅读
  9. Python 正则表达式 (?=...) 和 (?<=...) 符号

    2024-05-12 09:12:09       9 阅读
  10. Electron axios token失效刷新token

    2024-05-12 09:12:09       12 阅读
  11. 2024-05-11 问AI:在深度学习中,学习率是什么

    2024-05-12 09:12:09       11 阅读
  12. Python 实战之量化交易

    2024-05-12 09:12:09       11 阅读
  13. CentOS常见命令

    2024-05-12 09:12:09       6 阅读