Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to resolve build error: unknown type name '*' #5

Open
piaoger opened this issue Jan 18, 2020 · 2 comments
Open

how to resolve build error: unknown type name '*' #5

piaoger opened this issue Jan 18, 2020 · 2 comments

Comments

@piaoger
Copy link

piaoger commented Jan 18, 2020

Hi, I got build error: unknown type name '*' when trying to build this crate:

LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config cargo run --release --example h264_video_dec

  • Error report
--- stderr

--- stderr
/w/imager-io/ffmpeg-dev-rs/target/release/build/ffmpeg-dev-81b52e898a9ea16c/out/FFmpeg-FFmpeg-2722fc2/libavutil/buffer_internal.h:44:5: error: unknown type name 'atomic_uint'
/w/imager-io/ffmpeg-dev-rs/target/release/build/ffmpeg-dev-81b52e898a9ea16c/out/FFmpeg-FFmpeg-2722fc2/libavutil/buffer_internal.h:89:5: error: unknown type name 'atomic_uint'
/w/imager-io/ffmpeg-dev-rs/target/release/build/ffmpeg-dev-81b52e898a9ea16c/out/FFmpeg-FFmpeg-2722fc2/libavcodec/error_resilience.h:64:5: error: unknown type name 'atomic_int'
...

@colbyn
Copy link
Member

colbyn commented Jan 18, 2020

Ahh, first I don't think the LLVM_CONFIG_PATH path is a necessity (it's from a dependency called rust-bindgen), but perhaps I'm wrong (I've built this before without setting it).

Anyway in all honesty, this is a very strange error. Can you give me the full output instead of a summary? That may give me better context.

Also what is your OS?

But from what I gather, this definitely looks like an FFmpeg build issue. I wonder, this crate is supposed to be self contained, but perhaps this is still linking against some system dependency somehow (maybe the ffmpeg config flag --disable-autodetect isn't enough), and/or perhaps it's due to some untested linux distribution.

Oh, I noticed you had the --release flag set. Does this work in dev/debug mode? I.e. cargo run --example h264_video_dec, instead of cargo run --release --example h264_video_dec.

Another possibility I think, on my Mac I've built this using clang, and on Linux I'm pretty sure I've always used llvm/clang (e.g. here is a Dockerfile that builds this crate as a dependency). Maybe this is a bug in some codepath trigged by GCC. Do you have clang installed and available on your path?

Update: also just to be safe, when testing the GCC idea, rm -rf your build output dir, usually called target.

@piaoger
Copy link
Author

piaoger commented Jan 19, 2020

I am using macOS Mojave and running in debug mode does not help. I also tried to build the example on my Ubuntu 16.04 and got same error.

Below are more information, including clang version, llvm version and error details. Hope they are helpful for locating the reason :)

active toolchain
----------------
stable-x86_64-apple-darwin (default)
rustc 1.40.0 (73528e339 2019-12-16)
piaoger:ffmpeg-dev-rs piaoger$ /usr/local/opt/llvm/bin/llvm-config --version
8.0.0

piaoger$ clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
piaoger$ cargo run --example h264_video_dec
   Compiling ffmpeg-dev v0.3.8 (/w/imager-io/ffmpeg-dev-rs)
error: failed to run custom build command for `ffmpeg-dev v0.3.8 (/w/imager-io/ffmpeg-dev-rs)`

Caused by:
  process didn't exit successfully: `/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-5a16a3d1babc6a34/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavcodec
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavdevice
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavfilter
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavformat
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavutil
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libpostproc
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libswresample
cargo:rustc-link-search=native=/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libswscale
cargo:rustc-link-lib=static=avcodec
cargo:rustc-link-lib=static=avdevice
cargo:rustc-link-lib=static=avfilter
cargo:rustc-link-lib=static=avformat
cargo:rustc-link-lib=static=avutil
cargo:rustc-link-lib=static=swresample
cargo:rustc-link-lib=static=swscale
rerun-if-changed=headers
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 a valid `llvm-config` executable

--- stderr
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavutil/buffer_internal.h:44:5: error: unknown type name 'atomic_uint'
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavutil/buffer_internal.h:89:5: error: unknown type name 'atomic_uint'
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavcodec/error_resilience.h:64:5: error: unknown type name 'atomic_int'
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/internal.h:63:10: warning: 'AVMixCoeffType' is deprecated [-Wdeprecated-declarations]
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/avresample.h:112:6: note: 'AVMixCoeffType' has been explicitly marked deprecated here
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/internal.h:73:10: warning: 'AVResampleFilterType' is deprecated [-Wdeprecated-declarations]
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/avresample.h:123:6: note: 'AVResampleFilterType' has been explicitly marked deprecated here
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/internal.h:75:10: warning: 'AVResampleDitherMethod' is deprecated [-Wdeprecated-declarations]
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/avresample.h:132:6: note: 'AVResampleDitherMethod' has been explicitly marked deprecated here
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/resample.h:42:10: warning: 'AVResampleFilterType' is deprecated [-Wdeprecated-declarations]
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/avresample.h:123:6: note: 'AVResampleFilterType' has been explicitly marked deprecated here
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/audio_mix.h:55:33: warning: 'AVMixCoeffType' is deprecated [-Wdeprecated-declarations]
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/avresample.h:112:6: note: 'AVMixCoeffType' has been explicitly marked deprecated here
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavutil/buffer_internal.h:44:5: error: unknown type name 'atomic_uint', err: true
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavutil/buffer_internal.h:89:5: error: unknown type name 'atomic_uint', err: true
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavcodec/error_resilience.h:64:5: error: unknown type name 'atomic_int', err: true
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/internal.h:63:10: warning: 'AVMixCoeffType' is deprecated [-Wdeprecated-declarations], err: false
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/internal.h:73:10: warning: 'AVResampleFilterType' is deprecated [-Wdeprecated-declarations], err: false
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/internal.h:75:10: warning: 'AVResampleDitherMethod' is deprecated [-Wdeprecated-declarations], err: false
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/resample.h:42:10: warning: 'AVResampleFilterType' is deprecated [-Wdeprecated-declarations], err: false
/w/imager-io/ffmpeg-dev-rs/target/debug/build/ffmpeg-dev-b0fc1cca8b3d58d1/out/ffmpeg-4.2.2/libavresample/audio_mix.h:55:33: warning: 'AVMixCoeffType' is deprecated [-Wdeprecated-declarations], err: false
thread 'main' panicked at 'Unable to generate bindings: ()', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

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

No branches or pull requests

2 participants