无法 运行 为 qmlrs 自定义构建命令

Failed to run custom build command for qmlrs

我正在尝试使用 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.

您应该安装提供该文件的 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