linux - 如何 build qtwayland?

标签 linux qt qmake qtwayland

我花了一整天的时间尝试在 Qt creator 中使用 QtWayland.Compositor 1.0。我已经按照那里的所有步骤进行了操作 https://wiki.qt.io/QtWayland但我收到以下错误。不知道什么意思,那是我第一次接触linux。我在虚拟机上安装了最新的 linux mint。

$ sudo make install
cd src/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/emil/wayland/qtwayland/src/src.pro -o Makefile ) && make -f Makefile install
make[1]: Entering directory '/home/emil/wayland/qtwayland/src'
make[1]: Nothing to be done for 'install'.
make[1]: Leaving directory '/home/emil/wayland/qtwayland/src'
cd examples/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/emil/wayland/qtwayland/examples/examples.pro -o Makefile ) && make -f Makefile install
make[1]: Entering directory '/home/emil/wayland/qtwayland/examples'
cd wayland/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/emil/wayland/qtwayland/examples/wayland/wayland.pro -o Makefile ) && make -f Makefile install
make[2]: Entering directory '/home/emil/wayland/qtwayland/examples/wayland'
Some of the required modules (qtHaveModule(waylandcompositor) qtConfig(opengl)) are not available.
Skipped.
make[2]: Leaving directory '/home/emil/wayland/qtwayland/examples/wayland'
make[1]: Leaving directory '/home/emil/wayland/qtwayland/examples'

我该如何解决?我只想运行 Qt 安装中的示例 :c。

最佳答案

wiki 页面上的大部分内容都是多年前编写的。我努力清理我知道不再相关的东西,并希望让 wiki 页面处于可用状态。

在我看来,问题在于构建 Qt 的方法有很多,而如何构建 QtWayland 取决于此。

两个最常见的选项:

将 QtWayland 构建为完整(或顶层 Qt 构建)的一部分

配置Qt时,可以在配置行添加-feature-wayland-server。它将确保 Wayland 合成器 API 是您 Qt 构建的一部分。如果不满足 QtWayland 的依赖关系,配置将失败。 IE。如果您需要 Wayland 的开发包。

然后您可以只运行 make 它将构建您配置的所有 Qt,或者运行 make module-qtwayland 它将只构建 QtWayland 和所需的依赖项(qtbaseqtdeclarativeqtxmlpatterns)。

针对现有的 Qt 安装(没有 QtWayland)构建 QtWayland

首先,您需要为您所需的 Qt 版本找到 qmake。如果它是由系统提供的,它通常已经在您的 PATH 中了。如果您要使用 Qt 安装程序提供的 Qt,它通常位于 ~/Qt/5.10.0/gcc_64/bin/qmake 或适合您的版本和体系结构的等价物。

克隆qtwayland

git clone git://code.qt.io/qt/qtwayland.git
cd qtwayland
git checkout v5.10.0 #or whatever version your qmake reports

用qmake配置

qmake

~/Qt/5.10.0/gcc_64/bin/qmake

您现在应该看到:

Qt Wayland Client ........................ yes
Qt Wayland Compositor .................... yes

在您的终端中,否则您可能缺少一些依赖项。

用make构建

make
make install

构建示例

根据您的配置,这可能需要显式运行:

make sub-examples

关于linux - 如何 build qtwayland?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42352743/

相关文章:

c++ - 静态库可移植性

linux - 为什么 "pstack"只打印一个线程的内容?

c++ - 如何在 linux 中打包我的 c++ 项目的所有依赖库

c++ - Qt 对 boost::system::generic_category() 的 undefined reference

c++ - 使用 QMake 进行仅 header 和静态构建

linux - 在 Linux 上提取 TCP 往返时间 (RTT) 估计

Arduino I²C 库 (Wire) 的 Linux 等价物?

c++ - 使用Qt5 SQL进行异步数据库访问的策略

c++ - 获取对 const QString 的引用

qt - 如何使用qmake在单个项目中构建多个二进制文件?