英文:
rust glium compile error missing package on ubuntu
问题
I try compile this in Rust with glium
on an Ubutnu machine.
#[macro_use]
extern crate glium;
fn main() {
println!("Hello, world!");
}
It results in this error:
--- stderr
thread 'main' panicked at '`"pkg-config" "--libs" "--cflags" "fontconfig" "fontconfig >= 2.11.1"` did not exit successfully: exit status: 1
error: could not find system library 'fontconfig' required by the 'servo-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
No package 'fontconfig' found
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
No package 'fontconfig' found
', /home/matej/.cargo/registry/src/github.com-1ecc6299db9ec823/servo-fontconfig-sys-5.1.0/build.rs:34:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/matej/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-1.0.38/src/lib.rs:238:34
|
238 | #![cfg_attr(provide_any, feature(provide_any))]
| ^^^^^^^^^^^
The first error says it cannot find the fontconfig
library. What should I do here? How do I get that library installed? I do not know what to do with the second error, either.
OS: Ubuntu 22.04 LTS
I have added glium = "*"
to cargo dependencies.
Addendum
The first error is solved after running cargo clean
-
but the second error still persists. Any ideas?
英文:
I try compile this in Rust with glium
on an Ubutnu machine.
#[macro_use]
extern crate glium;
fn main() {
println!("Hello, world!");
}
It results in this error:
--- stderr
thread 'main' panicked at '`"pkg-config" "--libs" "--cflags" "fontconfig" "fontconfig >= 2.11.1"` did not exit successfully: exit status: 1
error: could not find system library 'fontconfig' required by the 'servo-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
No package 'fontconfig' found
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
No package 'fontconfig' found
', /home/matej/.cargo/registry/src/github.com-1ecc6299db9ec823/servo-fontconfig-sys-5.1.0/build.rs:34:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error[E0554]: `#![feature]` may not be used on the stable release channel
--> /home/matej/.cargo/registry/src/github.com-1ecc6299db9ec823/thiserror-1.0.38/src/lib.rs:238:34
|
238 | #![cfg_attr(provide_any, feature(provide_any))]
| ^^^^^^^^^^^
The first error says it cannot find the fontconfig
library. What should I do here? How do I get that library installed? I do not know what to do with the second error, either.
OS: Ubuntu 22.04 LTS
I have added glium = "*"
to cargo dependencies.
Addendum
The first error is solved after running cargo clean
-
but the second error still persists. Any ideas?
答案1
得分: 1
使用以下命令在终端中安装所需的依赖项:
sudo apt install libfontconfig1-dev
英文:
Using this command in the terminal, install the required dependency:
sudo apt install libfontconfig1-dev
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论