Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Build fails on Windows 10 64bit: { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libavformat\"", cause: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }} #64

Open
MichaelMauderer opened this issue Sep 6, 2018 · 4 comments

Comments

@MichaelMauderer
Copy link

I'll probably work around this by using a pre-built version of ffmpeg which should avoid any issues building it.

Full output

 Compiling ffmpeg-sys v3.4.1
error: failed to run custom build command for `ffmpeg-sys v3.4.1`
process didn't exit successfully: `C:\<snip>\target\debug\build\ffmpeg-sys-a162081edadd1e97\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Command { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libavformat\"", cause: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." } }', libcore\result.rs:945:5
stack backtrace:
   0: <std::sync::mpsc::select::Select as core::fmt::Debug>::fmt
   1: std::stdsimd::arch::detect::os::check_for
   2: std::panicking::take_hook
   3: std::panicking::take_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed<pkg_config::Error>
             at C:\projects\rust\src\libcore\macros.rs:26
   9: core::result::Result<pkg_config::Library, pkg_config::Error>::unwrap<pkg_config::Library,pkg_config::Error>
             at C:\projects\rust\src\libcore\result.rs:782
  10: build_script_build::main
             at .\build.rs:518
  11: std::rt::lang_start::{{closure}}<()>
             at C:\projects\rust\src\libstd\rt.rs:74
  12: std::panicking::update_panic_count
  13: _rust_maybe_catch_panic
  14: std::rt::lang_start_internal
  15: std::rt::lang_start<()>
             at C:\projects\rust\src\libstd\rt.rs:74
  16: main
  17: invoke_main
             at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  18: __scrt_common_main_seh
             at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283
  19: BaseThreadInitThunk
  20: RtlUserThreadStart
@jonfk
Copy link

jonfk commented Nov 29, 2018

The error message is indicating that you don't have pkg-config installed. pkg-config is a tool that helps a build find installed libraries (here the ffmpeg libraries).

@barzamin
Copy link
Collaborator

Unfortunately, pkg-config isn't really a good tool to use to find libraries on Windows (cf this post and this one, which I believe are still the current state of affairs). We should perhaps fall back to building ffmpeg from source if we can't find pkg-config, targeting msvc if necessary; this is, iirc, what libcurl-sys and other core Rust *-sys crates do.

@LukasKnuth
Copy link

Any workaround to get this thing working on Win10 for now?

Also, what are the prerequirements to build this crate? Do I need to download ffmpeg libs (source or bin) before being able to compile?

@kornelski
Copy link
Collaborator

Your best bet to get it working on Windows is to set the build feature, and let it compile ffmpeg from scratch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants