我试图将qmlrs Rust绑定用于Qt,但我无法编译。我已经安装了所有依赖项。
货物构建日志:
error: failed to run custom build command for `qmlrs v0.1.1`
Process didn't exit successfully: `/home/pedro/Documents/repositories
/rust-sample/target/debug/build/qmlrs-e7d90e9b9c603e6f/build-script-
build` (exit code: 101)
--- stdout
cargo:rustc-link-lib=static=qmlrswrapper
cargo:rustc-link-lib=dylib=stdc++
cargo:rustc-link-search=native=/home/pedro/.cargo/registry/src/github.com-
88ac128001ac3a9a/qmlrs-0.1.1/ext/libqmlrswrapper/build
--- stderr
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value:
"`\"pkg-config\" \"--libs\" \"--cflags\" \"Qt5Core Qt5Gui Qt5Qml
Qt5Quick\"` did not exit successfully: exit code: 1\n--- stdout\nPackage
Qt5Qml was not found in the pkg-config search path.\nPerhaps you should
add the directory containing `Qt5Qml.pc\'\nto the PKG_CONFIG_PATH
environment variable\nNo package \'Qt5Qml\' found\nPackage Qt5Quick was
not found in the pkg-config search path.\nPerhaps you should add the
directory containing `Qt5Quick.pc\'\nto the PKG_CONFIG_PATH environment
variable\nNo package \'Qt5Quick\' found\n"', ../src/libcore/result.rs:746
note: Run with `RUST_BACKTRACE=1` for a backtrace.
答案 0 :(得分:1)
您应该安装提供该文件的Qt的-dev
包。 Here's a hint如何使用apt-file找到相关的包(如果你使用的是Debian派生的发行版)。
在您的情况下,错误消息说
Perhaps you should add the directory containing Qt5Qml.pc
,所以:
$ sudo apt install apt-file && sudo apt update
$ apt-file search Qt5Qml.pc
>>> qtdeclarative5-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/Qt5Qml.pc
$ sudo apt install qtdeclarative5-dev