English 中文(简体)
无法运行“jeslogic-fontconfig-sys v3.2.0” 自定义构建命令
原标题:failed to run custom build command for `yeslogic-fontconfig-sys v3.2.0`

我试图学习如何在拉斯特绘制地图, 并找到使用绘图师的指南(如果有人知道有更好的图书馆可以让我知道) 。

https://plotters-rs.github.io/book/intro/getting_started.html

总之,我是在Fedora 37, 并使用指南的“获取开始”部分所展示的例子, 遇到一个问题。

代码是:

/*
Example of plotting in Rust
*/

use plotters::prelude::*;

fn main() {
    
    let root_drawing_area = BitMapBackend::new("0.1.png", (1024, 768))
        .into_drawing_area();

    root_drawing_area.fill(&WHITE).unwrap();

    let mut chart = ChartBuilder::on(&root_drawing_area)
        .build_cartesian_2d(-3.14..3.14, -1.2..1.2)
        .unwrap();

    chart.draw_series(LineSeries::new(
        (-314..314).map(|x| x as f64 / 100.0)
        .map(|x| (x, x.sin())), &RED))
        .unwrap();

}

在我的货物.toml 文件中,我用 cargo 添加了依赖性,添加了绘图器

但当我用 cargo building 来运行代码时, 我就会发现这个错误 :

Compiling yeslogic-fontconfig-sys v3.2.0
error: failed to run custom build command for `yeslogic-fontconfig-sys v3.2.0`

Caused by:
  process didn t exit successfully: `/home/usr/Dev/RustyKrab/plotting/plot_example/target/debug/build/yeslogic-fontconfig-sys-3bf9e95194fbfdbd/build-script-build` (exit status: 101)

继续坚持下去

--- stdout
  cargo:rerun-if-env-changed=RUST_FONTCONFIG_DLOPEN
  cargo:rerun-if-env-changed=FONTCONFIG_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=FONTCONFIG_STATIC
  cargo:rerun-if-env-changed=FONTCONFIG_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

和标准计算器

--- stderr
  thread  main  panicked at  called `Result::unwrap()` on an `Err` value: "`"pkg-config" "--libs" "--cflags" "fontconfig"` did not exit successfully: exit status: 1
error: could not find system library  fontconfig  required by the  yeslogic-fontconfig-sys  crate

--- stderr
Package fontconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `fontconfig.pc 
to the PKG_CONFIG_PATH environment variable
Package  fontconfig , required by  virtual:world , not found
" , /home/usr/.cargo/registry/src/github.com-1ecc6299db9ec823/yeslogic-fontconfig-sys-3.2.0/build.rs:8:48

错误最后一行为 note: 使用 `RUST_BACKTRACE=1' 环境变量运行,以显示回溯跟踪 。 我尝试运行 RUST_BACKTRACE=1 alacrity ,但只是不起作用。

我怎么能在这附近工作 这样我才能在拉斯特用绘图机?

注意: 我已经安装了字体配置, 使用 sudo dnf 安装字体配置

最佳回答
问题回答

对于使用 Linux 薄荷薄荷的人来说,你想要的应该是 libfontconfig1-dev ,而从我所看到的我所怀疑的情况来看,对于其他以德文为根据的暴动者来说,情况也是如此





相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签