【问题标题】:Force QT to use system protobuf version强制 QT 使用系统 protobuf 版本
【发布时间】:2018-03-03 22:23:53
【问题描述】:

在 Linux (Ubuntu 17.10) 下编译 paraview 和 Qt 时,我正在尝试解决著名的 protobuf 版本错误(见下文)。

This program requires version 3.0.0 of the Protocol Buffer runtime 
library, but the installed version is 2.3.0.  Please update your 
library.  If you compiled the program yourself, make sure that your 
headers are from the same version of Protocol Buffers as your link-time 
library.

为了开发一个与网页二进制文件兼容的插件,我想用 Qt-5.8 编译 paraview。因此,我使用 Qt 下载脚本下载了源代码。我确实编译成功了Qt,但是因为出现上面的错误,所以在编译运行paraview的时候,我假设Qt没有使用protobuf的系统版本,应该是3.0,而是内置的版本。

据我所知,构建脚本会评估是否使用系统 protobuf 版本(例如在 qtwebengine/src/core/config/linux.pri:65 中)。

有没有办法检查使用哪个 protobuf 版本来编译 Qt? 我可以以某种方式强制执行吗?我假设如果安装了 libprotobuf-dev 包,它会被检测到,但我不知道如何检查。

我知道这个网站上有类似的问题(例如link),但其中的答案还没有解决我的问题。

【问题讨论】:

    标签: linux qt ubuntu protocol-buffers paraview


    【解决方案1】:

    这已在ParaView issue tracker 中记录。

    目前有两种解决方案:

    1. 构建你自己的 Qt
    2. 使用以下解决方法:
      • 在某处提取/安装 Qt 的二进制版本,确保您的计算机上只有一个,以避免任何类型的冲突
      • 删除 /opt/Qt/5.9/gcc_64/plugins/platformthemes/libqgtk3.so
      • 编辑和注释掉/opt/Qt/5.9/gcc_64/lib/cmake/Qt5Gui/Qt5Gui_QGtk3ThemePlugin.cmake
      • 重启电脑
      • 开始paraview

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-24
      • 2010-09-05
      • 2010-10-30
      • 1970-01-01
      • 2015-11-26
      • 1970-01-01
      相关资源
      最近更新 更多