zmwangx / rust-ffmpeg

Safe FFmpeg wrapper.
Do What The F*ck You Want To Public License
1.3k stars 203 forks source link

Problem with libclang.dll on Windows 11 #169

Open mcprotector opened 9 months ago

mcprotector commented 9 months ago

Windows 11 Rust for Visual Studio

That message in build info: Unable to find libclang: "couldn't find any valid shared libraries matching: ['clang.dll', 'libclang.dll'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (invalid: [])

A lot of versions for clang downloaded, LIBCLANG_PATH set, but don't work.

EpicCodeWizard commented 9 months ago

Hi there, I faced the same issue and did the following steps to fix it (not sure if this will work for you).

  1. Download a prebuilt version of clang.dll and libclang.dll: https://ziglang.org/deps/llvm+clang+lld-10.0.0-x86_64-windows-msvc-release-mt.tar.xz
  2. Extract to a folder, then set the environment variable LIBCLANG_PATH to path\llvm+clang+lld-10.0.0-x86_64-windows-msvc-release-mt\bin
  3. The bin folder contains the required libraries and executables

After that, compiling and running my project worked out well. Please let me know if you run into any issues.

EpicCodeWizard commented 9 months ago

@mcprotector

mcprotector commented 9 months ago

Yes, I managed to solve this problem. It turned out that we needed to enter the path directly into the System.

Now I have another problem. Immediately after ffmpeg is initiated, system messages cannot be displayed on the console screen. And I basically don’t see what’s going on inside there.

EpicCodeWizard commented 9 months ago

Not sure what you mean, can you provide some error logs?

mcprotector commented 9 months ago

Not sure what you mean, can you provide some error logs?

There is no errors. Simply ffmpeg::init().unwrap(); block println output. Without I can echo messages to console. When ffmpeg is inited console have no messages.

println!("Hello World!"); output "Hello World!"

ffmpeg::init().unwrap();
println!("Hello World!");

empty output.