当我尝试在Ubuntu 18.04上对amethyst的“hello world”进行cargo build
编码时,我收到有关lxbcb缺少库的错误。我不确定此错误试图告诉我什么或如何解决。似乎我缺少图书馆-lxcb-render
,-lxcb-shap
和-lxcb-xfixes
,但是我似乎找不到它们。
紫 Crystal Hello World 代码
extern crate amethyst;
use amethyst::{
prelude::*,
renderer::{DisplayConfig, DrawFlat, Pipeline, PosNormTex, RenderBundle, Stage, VirtualKeyCode},
utils::application_root_dir,
input::is_key_down,
};
struct Example;
impl SimpleState for Example {}
fn main() -> amethyst::Result<()> {
amethyst::start_logger(Default::default());
let path = format!(
"{}/resources/display_config.ron",
application_root_dir()
);
let config = DisplayConfig::load(&path);
let pipe = Pipeline::build().with_stage(
Stage::with_backbuffer()
.clear_target([0.00196, 0.23726, 0.21765, 1.0], 1.0)
.with_pass(DrawFlat::<PosNormTex>::new()),
);
let game_data =
GameDataBuilder::default().with_bundle(RenderBundle::new(pipe, Some(config)))?;
let mut game = Application::new("./", Example, game_data)?;
game.run();
Ok(())
}
cargo build
输出(由于存在字符限制,因此删除了一些rustc
命令)brad@rhyme:~/Development/amethyst_setup/gametest$ cargo run --verbose
Fresh unicode-xid v0.1.0
Fresh cc v1.0.35
Fresh semver-parser v0.7.0
Fresh cfg-if v0.1.7
Fresh nodrop v0.1.13
Fresh rand_core v0.4.0
Fresh autocfg v0.1.2
Fresh xml-rs v0.8.0
Fresh scopeguard v0.3.3
Fresh memoffset v0.2.1
Fresh lazy_static v1.3.0
Fresh stable_deref_trait v1.1.1
Fresh void v1.0.2
Fresh bitflags v1.0.4
Fresh crossbeam-utils v0.5.0
Fresh pkg-config v0.3.14
Fresh same-file v1.0.4
Fresh linked-hash-map v0.5.2
Fresh downcast-rs v1.0.4
Fresh either v1.5.2
Fresh atom v0.3.5
Fresh mopa v0.2.2
Fresh xdg v2.2.0
Fresh rawpointer v0.1.0
Fresh rustc-demangle v0.1.14
Fresh futures v0.1.26
Fresh fnv v1.0.6
Fresh tuple_utils v0.2.0
Fresh libm v0.1.2
Fresh mint v0.5.1
Fresh adler32 v1.0.3
Fresh unicode-xid v0.0.4
Fresh percent-encoding v1.0.1
Fresh lzw v0.10.0
Fresh approx v0.1.1
Fresh color_quant v1.0.1
Fresh quote v0.3.15
Fresh build_const v0.2.1
Fresh scoped_threadpool v0.1.9
Fresh siphasher v0.2.3
Fresh xi-unicode v0.1.0
Fresh wavefront_obj v5.1.0
Fresh hetseq v0.2.0
Fresh ansi_term v0.11.0
Fresh unicode-width v0.1.5
Fresh claxon v0.3.2
Fresh hound v3.4.0
Fresh matches v0.1.8
Fresh strsim v0.8.0
Fresh vec_map v0.8.1
Fresh hashbrown v0.2.2
Fresh float-ord v0.2.0
Fresh fluent-locale v0.4.1
Fresh unicode-segmentation v1.2.1
Fresh semver v0.9.0
Fresh crossbeam-utils v0.2.2
Fresh proc-macro2 v0.3.8
Fresh cmake v0.1.38
Fresh rand_core v0.3.1
Fresh crossbeam-utils v0.6.5
Fresh rand_jitter v0.1.3
Fresh colored v1.7.0
Fresh owning_ref v0.4.0
Fresh owning_ref v0.3.3
Fresh xml-rs v0.7.0
Fresh walkdir v2.2.7
Fresh itertools v0.7.11
Fresh synom v0.11.3
Fresh inflate v0.4.5
Fresh gif v0.10.1
Fresh phf_shared v0.7.24
Fresh annotate-snippets v0.1.0
Fresh textwrap v0.11.0
Fresh proc-macro2 v0.4.27
Fresh rustc_version v0.2.3
Fresh libc v0.2.51
Fresh arrayvec v0.4.10
Fresh rand_hc v0.1.0
Fresh rand_xorshift v0.1.1
Fresh rand_isaac v0.1.1
Fresh quote v0.5.2
Fresh num-traits v0.2.6
Fresh byteorder v1.3.1
Fresh lock_api v0.1.5
Fresh khronos_api v2.2.0
Fresh khronos_api v3.1.0
Fresh typenum v1.10.0
Fresh nonzero_signed v1.0.3
Fresh matrixmultiply v0.1.15
Fresh syn v0.11.11
Fresh quote v0.6.12
Fresh libloading v0.5.0
Fresh crossbeam-epoch v0.3.1
Fresh rand v0.5.6
Fresh rand v0.4.6
Fresh num_cpus v1.10.0
Fresh nix v0.13.0
Fresh crossbeam-epoch v0.7.1
Fresh rand_os v0.1.3
Fresh crossbeam-epoch v0.5.2
Fresh crossbeam-epoch v0.6.1
Fresh memmap v0.7.0
Fresh shared_library v0.1.9
Fresh time v0.1.42
Fresh slice-deque v0.1.16
Fresh phf v0.7.24
Fresh atty v0.2.11
Fresh memmap v0.6.2
Fresh fluent-syntax v0.1.1
Fresh dirs v1.0.5
Fresh ordered-float v1.0.2
Fresh approx v0.3.2
Fresh line_drawing v0.7.0
Fresh backtrace-sys v0.1.28
Fresh num-integer v0.1.39
Fresh syn v0.13.11
Fresh num-traits v0.1.43
Fresh minimp3-sys v0.3.1
Fresh rand_chacha v0.1.1
Fresh rustc-hash v1.0.1
Fresh stb_truetype v0.2.6
Fresh rand_pcg v0.1.2
Fresh fxhash v0.2.1
Fresh deflate v0.7.19
Fresh base64 v0.10.1
Fresh ogg v0.7.0
Fresh syn v0.15.32
Fresh wayland-scanner v0.21.12
Fresh generic-array v0.11.1
Fresh x11-dl v2.18.3
Fresh gfx_macros v0.2.1
Fresh alsa-sys v0.1.2
Fresh crc v1.8.1
Fresh dlib v0.4.1
Fresh crossbeam-deque v0.2.0
Fresh crossbeam-deque v0.7.1
Fresh rand v0.3.23
Fresh crossbeam-deque v0.5.2
Fresh osmesa-sys v0.1.2
Fresh intl_pluralrules v1.0.3
Fresh clap v2.33.0
Fresh backtrace v0.3.15
Fresh num-bigint v0.2.2
Fresh num-iter v0.1.37
Fresh chrono v0.4.6
Fresh cgmath v0.16.1
Fresh glsl-layout-derive v0.1.1
Fresh servo-freetype-sys v4.0.5
Fresh expat-sys v2.1.6
Fresh minimp3 v0.3.2
Fresh rand v0.6.5
Fresh serde_derive v1.0.90
Fresh derivative v1.0.2
Fresh shred-derive v0.5.1
Fresh num-derive v0.2.4
Fresh euclid_macros v0.1.0
Fresh synstructure v0.10.1
Fresh amethyst_derive v0.3.0
Fresh getset v0.0.7
Fresh wayland-sys v0.21.12
Fresh rayon-core v1.4.1
Fresh rusttype v0.7.6
Fresh cpal v0.8.2
Fresh cgmath v0.14.1
Fresh error-chain v0.12.0
Fresh num-rational v0.2.1
Fresh png v0.12.0
Fresh rustc_version_runtime v0.1.5
Fresh serde v1.0.90
Fresh genmesh v0.6.2
Fresh servo-fontconfig-sys v4.0.7
Fresh twox-hash v1.2.0
Fresh freetype v0.4.1
Fresh tiff v0.2.2
Fresh euclid v0.19.8
Fresh failure_derive v0.1.5
Fresh wayland-commons v0.21.12
Fresh rayon v1.0.3
Fresh andrew v0.2.1
Fresh glyph_brush_layout v0.1.5
Fresh vergen v2.1.3
Fresh smallvec v0.6.9
Fresh log v0.4.6
Fresh num-complex v0.2.1
Fresh draw_state v0.8.0
Fresh ron v0.4.2
Fresh bincode v1.1.3
Fresh uuid v0.7.4
Fresh lyon_geom v0.12.4
Fresh servo-fontconfig v0.4.0
Fresh failure v0.1.5
Fresh parking_lot_core v0.3.1
Fresh parking_lot_core v0.2.14
Fresh wayland-client v0.21.12
Fresh gl_generator v0.9.0
Fresh parking_lot_core v0.4.0
Fresh hibitset v0.5.4
Fresh shred v0.7.2
Fresh gl_generator v0.10.0
Fresh alga v0.7.2
Fresh jpeg-decoder v0.1.15
Fresh xcb v0.8.2
Fresh lewton v0.9.4
Fresh num v0.2.0
Fresh glyph_brush v0.4.2
Fresh unicode-normalization v0.1.8
Fresh crossbeam-channel v0.3.8
Fresh fern v0.5.8
Fresh gfx_core v0.8.3
Fresh parking_lot v0.6.4
Fresh parking_lot v0.5.5
Fresh amethyst_config v0.9.0
Fresh lyon_path v0.12.0
Fresh laminar v0.1.0
Fresh fluent v0.4.3
Fresh wayland-protocols v0.21.12
Fresh parking_lot v0.7.1
Fresh nalgebra v0.16.13
Fresh image v0.20.1
Fresh x11-clipboard v0.3.1
Fresh rodio v0.8.1
Fresh crossbeam-channel v0.2.6
Fresh glsl-layout v0.1.1
Fresh gfx v0.17.1
Fresh minterpolate v0.4.0
Fresh shrev v1.0.1
Fresh smithay-client-toolkit v0.4.5
Fresh font-kit v0.1.0
Fresh crossbeam v0.4.1
Fresh clipboard v0.5.0
Fresh gfx_glyph v0.13.3
Fresh specs v0.14.3
Fresh winit v0.18.1
Fresh gfx_gl v0.5.0
Fresh specs-hierarchy v0.3.0
Fresh glutin v0.19.0
Fresh amethyst_core v0.5.0
Fresh gfx_device_gl v0.15.5
Fresh amethyst_assets v0.6.0
Fresh gfx_window_glutin v0.27.0
Fresh amethyst_network v0.3.0
Fresh amethyst_renderer v0.10.4
Fresh amethyst_audio v0.5.0
Fresh amethyst_locale v0.4.0
Fresh amethyst_input v0.6.0
Fresh amethyst_animation v0.5.0
Fresh amethyst_controls v0.4.0
Fresh amethyst_ui v0.5.0
Fresh amethyst_utils v0.5.0
Fresh amethyst v0.10.0
Compiling gametest v0.1.0 (/home/brad/Development/amethyst_setup/gametest)
Running `rustc --edition=2018 --crate-name gametest src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8a344c992f010775 -C extra-filename=-8a344c992f010775 --out-dir /home/brad/Development/amethyst_setup/gametest/target/debug/deps -C incremental=/home/brad/Development/amethyst_setup/gametest/target/debug/incremental -L dependency=/home/brad/Development/amethyst_setup/gametest/target/debug/deps --extern amethyst=/home/brad/Development/amethyst_setup/gametest/target/debug/deps/libamethyst-618119f166e173bf.rlib -L native=/home/brad/Development/amethyst_setup/gametest/target/debug/build/backtrace-sys-af21dccdd6a6a2ad/out -L native=/home/brad/Development/amethyst_setup/gametest/target/debug/build/libloading-ec1dd9ac5a65377a/out ...-Wl,--end-group" "/home/brad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-c4b4b16c70e666d9.rlib" "-Wl,-Bdynamic" "-lexpat" "-lxcb" "-lxcb" "-lxcb" "-lxcb" "-lxcb-render" "-lxcb-shape" "-lxcb-xfixes" "-lasound" "-ldl" "-ldl" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
= note: /usr/bin/ld: cannot find -lxcb-render
/usr/bin/ld: cannot find -lxcb-shape
/usr/bin/ld: cannot find -lxcb-xfixes
collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: Could not compile `gametest`.
Caused by:
process didn't exit successfully: `rustc --edition=2018 --crate-name gametest src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8a344c992f010775 -C extra-filename=-8a344c992f010775 --out-dir /home/brad/Development/amethyst_setup/gametest/target/debug/deps -C incremental=/home/brad/Development/amethyst_setup/gametest/target/debug/incremental -L dependency=/home/brad/Development/amethyst_setup/gametest/target/debug/deps --extern amethyst=/home/brad/Development/amethyst_setup/gametest/target/debug/deps/libamethyst-618119f166e173bf.rlib -L native=/home/brad/Development/amethyst_setup/gametest/target/debug/build/backtrace-sys-af21dccdd6a6a2ad/out -L native=/home/brad/Development/amethyst_setup/gametest/target/debug/build/libloading-ec1dd9ac5a65377a/out -L native=/usr/lib/x86_64-linux-gnu -L native=/home/brad/Development/amethyst_setup/gametest/target/debug/build/minimp3-sys-23d2f40602e9e7e8/out -L native=/home/brad/Development/amethyst_setup/gametest/target/debug/build/servo-freetype-sys-3c5b6f9e4acfbf1c/out/lib -L native=/home/brad/Development/amethyst_setup/gametest/target/debug/build/servo-fontconfig-sys-e66049aa5a9b8f2a/out -L native=/usr/lib/x86_64-linux-gnu` (exit code: 1)
包裹信息(我认为这是包含我所缺少的包裹)
brad@rhyme:~/Development/amethyst_setup/gametest$ sudo apt-get install libx11-xcb-dev
[sudo] password for brad:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libx11-xcb-dev is already the newest version (2:1.6.4-3ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.
最佳答案
好像我错过了安装一些依赖项。sudo apt install pkg-config libasound2-dev libssl-dev cmake libfreetype6-dev libexpat1-dev libxcb-composite0-dev
https://github.com/amethyst/amethyst#debianubuntu
关于linux - 带有Rust和Amethyst的Linux上缺少的库,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55758892/