chrisvest / xxv

The XXV visual hex viewer for the terminal.
https://chrisvest.github.io/xxv/
85 stars 5 forks source link

Cargo install issues #13

Closed srufle closed 5 years ago

srufle commented 5 years ago

Using: stable-x86_64-unknown-linux-gnu (default) rustc 1.34.1 (fc50f328b 2019-04-24) cargo 1.34.0 (6789d8a0a 2019-04-01)

Tried cargo install xv received.

Compiling ncurses v5.99.0 (/home/srufle/code/github.com/ncurses-rs)
error: failed to run custom build command for `ncurses v5.99.0 (/home/srufle/code/github.com/ncurses-rs)`
process didn't exit successfully: `/home/srufle/code/github.com/ncurses-rs/target/debug/build/ncurses-205a0782d1415f39/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rustc-link-lib=ncurses
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")

--- stderr
/home/srufle/code/github.com/ncurses-rs/target/debug/build/ncurses-09c413476e50b4b0/out/chtype_size.c:6:10: fatal error: ncurses.h: No such file or directory
 #include <ncurses.h>
          ^~~~~~~~~~~
compilation terminated.
thread 'main' panicked at 'assertion failed: command.status().expect("compilation failed").success()', build.rs:105:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Fixed by sudo apt-get install ncurses-dev

Tried cargo install xv again received

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/srufle/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/cargo-installw62YIl/release/deps/xv-dc4a671fee87ad48.xv.57xxopd5-cgu.0.rcgu.o" "-o" "/tmp/cargo-installw62YIl/release/deps/xv-dc4a671fee87ad48" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/tmp/cargo-installw62YIl/release/deps" "-L" "/tmp/cargo-installw62YIl/release/build/backtrace-sys-b9dc6c3db1afc696/out" "-L" "/home/srufle/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustc20eSFZ/libbacktrace_sys-44efdd5e993998ee.rlib" "-Wl,--start-group" "/tmp/rustc20eSFZ/libbacktrace_sys-8dcce133820ce36b.rlib" "-Wl,--end-group" "/home/srufle/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-ccce53ba085ea72e.rlib" "-Wl,-Bdynamic" "-lncursesw" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/bin/ld: cannot find -lncursesw
          collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: failed to compile `xv v0.1.0`, intermediate artifacts can be found at `/tmp/cargo-installw62YIl`

Caused by:
  Could not compile `xv`.

To learn more, run the command again with --verbose.
chrisvest commented 5 years ago

Hi @srufle,

What Linux distro and version are you running?

chrisvest commented 5 years ago

If you are using Ubuntu, try running the following commands before the cargo install one:

sudo apt install gcc libncursesw5-dev
chrisvest commented 5 years ago

Instructions have been added to wiki and readme: https://github.com/chrisvest/xv/wiki

srufle commented 5 years ago

Yep fixed, thanks