l1npengtul / libuvc-rs

Rust wrapper around libuvc
MIT License
48 stars 18 forks source link

Failed to build on Ubuntu #11

Closed justinmoon closed 4 years ago

justinmoon commented 4 years ago
$ git clone --recurse-submodules git@github.com:mulimoen/libuvc-rs.git
$ cd libuvc-rs
$ cargo build --features vendor
    Updating crates.io index
   Compiling libc v0.2.79
   ...
   Compiling uvc-src v0.2.0 (/home/justin/libuvc-rs/uvc-src)
The following warnings were emitted during compilation:

warning: couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
warning: set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)

error: failed to run custom build command for `uvc-sys v0.1.4 (/home/justin/libuvc-rs/uvc-sys)`

Caused by:
  process didn't exit successfully: `/home/justin/libuvc-rs/target/debug/build/uvc-sys-6d3c0da2305fc1f2/build-script-build` (exit code: 101)
  --- stdout
  cargo:rustc-link-lib=uvc
  cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
  cargo:warning=set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)

  --- stderr
  wrapper.h:1:10: fatal error: 'libuvc/libuvc.h' file not found
  wrapper.h:1:10: fatal error: 'libuvc/libuvc.h' file not found, err: true
  thread 'main' panicked at 'Failed to generate bindings: ()', uvc-sys/build.rs:14:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
mulimoen commented 4 years ago

@justinmoon The default is to use the system libraries, you will need to use

cargo b --features vendor --no-default-features

for a static only library. I should probably add a compile time error for this

justinmoon commented 4 years ago

Thanks for the quick response! That fixed it.

I saw the note about disabling "default-features" in your README but didn't know what that meant.