cannot find -lclang.dll: No such file or directory and error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
1. Operating system
win10 msys2 mingw $ pacman -Q base 2022.06-1 bash 5.2.026-1 bash-completion 2.14.0-1 binutils 2.42-1 brotli 1.1.0-1 bsdtar 3.7.4-1 bzip2 1.0.8-4 ca-certificates 20240203-2 coreutils 8.32-5 curl 8.9.0-1 dash 0.5.12-1 db 6.2.32-5 diffutils 3.10-1 file 5.45-3 filesystem 2023.02.07-2 findutils 4.10.0-2 gawk 5.3.0-1 gcc 13.3.0-1 gcc-libs 13.3.0-1 gdbm 1.24-1 getent 2.18.90-4 gettext 0.22.4-1 gmp 6.3.0-1 gnupg 2.4.5-1 grep 1~3.0-6 gzip 1.13-1 heimdal-libs 7.8.0-5 inetutils 2.5-2 info 7.1-3 isl 0.26-1 less 661-1 libargp 20110921-4 libasprintf 0.22.4-1 libassuan 2.5.7-1 libbz2 1.0.8-4 libcurl 8.9.0-1 libdb 6.2.32-5 libedit 20240517_3.1-1 libexpat 2.6.2-1 libffi 3.4.6-1 libgcrypt 1.11.0-1 libgdbm 1.24-1 libgettextpo 0.22.4-1 libgnutls 3.8.6-1 libgpg-error 1.50-1 libhogweed 3.10-1 libiconv 1.17-1 libidn2 2.3.7-1 libintl 0.22.4-1 libksba 1.6.7-1 liblz4 1.10.0-1 liblzma 5.6.2-1 libnettle 3.10-1 libnghttp2 1.62.1-1 libnpth 1.7-1 libopenssl 3.3.1-1 libp11-kit 0.25.5-2 libpcre 8.45-4 libpcre2_8 10.44-1 libpsl 0.21.5-2 libreadline 8.2.010-1 libsqlite 3.46.0-2 libssh2 1.11.0-1 libtasn1 4.19.0-1 libunistring 1.2-1 libutil-linux 2.35.2-4 libxcrypt 4.4.36-1 libzstd 1.5.6-1 llvm 11.0.0-5 m4 1.4.19-2 make 4.4.1-2 mingw-w64-x86_64-binutils 2.42-2 mingw-w64-x86_64-crt-git 12.0.0.r81.g90abf784a-1 mingw-w64-x86_64-gcc 14.1.0-3 mingw-w64-x86_64-gcc-libs 14.1.0-3 mingw-w64-x86_64-gettext-runtime 0.22.5-2 mingw-w64-x86_64-gmp 6.3.0-2 mingw-w64-x86_64-headers-git 12.0.0.r81.g90abf784a-1 mingw-w64-x86_64-isl 0.26-1 mingw-w64-x86_64-libiconv 1.17-4 mingw-w64-x86_64-libwinpthread-git 12.0.0.r81.g90abf784a-1 mingw-w64-x86_64-mpc 1.3.1-2 mingw-w64-x86_64-mpfr 4.2.1-2 mingw-w64-x86_64-windows-default-manifest 6.4-4 mingw-w64-x86_64-winpthreads-git 12.0.0.r81.g90abf784a-1 mingw-w64-x86_64-zlib 1.3.1-1 mingw-w64-x86_64-zstd 1.5.6-2 mintty 1~3.7.4-1 mpc 1.3.1-1 mpfr 4.2.1-1 msys2-keyring 1~20240410-2 msys2-launcher 1.5-1 msys2-runtime 3.5.3-5 msys2-runtime-devel 3.5.3-5 msys2-w32api-headers 12.0.0.r0.g819a6ec2e-1 msys2-w32api-runtime 12.0.0.r0.g819a6ec2e-1 nano 8.1-1 ncurses 6.5-1 nettle 3.10-1 openssl 3.3.1-1 p11-kit 0.25.5-2 pacman 6.1.0-4 pacman-contrib 1.10.6-1 pacman-mirrors 20240523-1 perl 5.38.2-2 pinentry 1.3.1-1 rebase 4.5.0-4 sed 4.9-1 tar 1.35-2 time 1.9-3 tzcode 2024a-1 util-linux 2.35.2-4 wget 1.24.5-2 which 2.21-4 windows-default-manifest 6.4-2 xz 5.6.2-1 zlib 1.3.1-1 zstd 1.5.6-1
2. The way you installed OpenCV: package, official binary distribution, manual compilation, etc.
choco opencv4.10.0
3. rustc version (rustc --version)
Default host: x86_64-pc-windows-gnu rustup home: C:\Users\xxx.rustup
installed toolchains
stable-x86_64-pc-windows-gnu (default) stable-x86_64-pc-windows-msvc
active toolchain
stable-x86_64-pc-windows-gnu (default) rustc 1.80.0 (051478957 2024-07-21)
4. Attach the full output of the following command from your project directory:
RUST_BACKTRACE=full cargo run -vv
console:
Compiling opencv v0.92.2
Running set CARGO='\\?\C:\Users\xxx\.cargo\bin\cargo.exe'&& set CARGO_CRATE_NAME=build_script_build&& set CARGO_MANIFEST_DIR='C:\Users\xxx\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ opencv-0.92.2'&& set CARGO_PKG_AUTHORS='Pro <[email protected]>:Mathieu Poumeyrol <[email protected]>'&& set CARGO_PKG_DESCRIPTION='Rust bindings for OpenCV'&& set CARGO_PKG_HOMEPAGE=''&& set CARGO_PKG_LICENSE= MIT&& set CARGO_PKG_LICENSE_FILE=''&& set CARGO_PKG_NAME=opencv&& set CARGO_PKG_README=README.md&& xtern 'vcpkg=D:\msys64\home\xxx\rust_project\rust_opencv\target\debug\deps\libvcpkg-d7522db353770f9f.rlib' --cap-lints war n -L 'C:\Program Files\LLVM\bin'
error: linking with x86_64-w64-mingw32-gcc failed: exit code: 1
|
= note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase"
... "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "C:\Users\xxx\.rustup\toolchains\stable-x86_64-pc-window s-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\rsbegin.o" "D:\msys64\tmp\rustcu7PYXe\symbols.o" "D:\msys64\home\xxx\rust_project\rust_opencv\target\debug\build\opencv-d64bd1cdb96880d2\buil d_script_build-d64bd1cdb96880d2.build_script_build.b78453023d80483-cgu.00.rcgu.o" "D:\msys64\home\xxx\rust_project\rust_opencv\target\debug\build\opencv-d64bd1cdb96880d2\build_script_build-d64bd t\debug\deps\libpercent_encoding-f0462e9bee78e064.rlib" "D:\msys64\home\xxx\rus t_project\rust_opencv\target\debug\deps\libregex-96e4cda395b3a661.rlib" "D:\msys64\home\xxx\rust_project\rust_opencv\target\debug\deps\libregex_automata-051ad8e61"C:\Users\xxx\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\rsend.o" = note: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lclang.dll: No such file or directory collect2.exe: error: ld returned 1 exit status ...
error: could not compile opencv (build script) due to 1 previous error
Caused by:
process didn't exit successfully: set CARGO='\\?\C:\Users\xxx\.cargo\bin\cargo.exe'&& set CARGO_CRATE_NAME=build_script_build&& set CARGO_MANIFEST_DIR='C:\Users\xxx\.cargo\registry\src\index.crat es.io-6f17d22bba15001f\opencv-0.92.2'&& set CARGO_PKG_AUTHORS='Pro <[email protected]>:Mathieu Poumeyrol <[email protected]>'&& set CARGO_PKG_DESCRIPTION='Rust bindings for OpenCV'&& set CARGO_PKG_HOMEPAGE=''&& set CARGO_PKG_LICENSE=MIT&& set CARGO_PKG_LICENSE_FILE=''&& set CARGO_PKG_NAME=opencv&& set CARGO_PKG_README=README.md&& set'vcpkg=D:\msys64\home\xxx\rust_project\rust_opencv\target\debug\deps\libvcpkg-d7522db353770f9 f.rlib' --cap-lints warn -L 'C:\Program Files\LLVM\bin' (exit code: 1)
warning: build failed, waiting for other jobs to finish...