-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Build failed. Cannot link clang.dll #305
Comments
Here are my compilation steps:
I have successfully compiled with |
So I tried to install opencv-rust, but error
cannot find -lclang.dll
happened.Opencv was build from source. About
ENV
cargo run
cannot build opencv because it cannot link clang.dll(which I honesty couldn't find myself). clang was downloaded from winlibs.com. llvm and installed with commandchoco install llvm
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" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\rsbegin.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.0.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.1.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.10.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.11.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.12.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.13.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.14.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.15.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.2.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.3.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.4.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.5.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.6.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.7.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.8.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.build_script_build.101074c8-cgu.9.rcgu.o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.41wt457u3tk3yk7d.rcgu.o" "-L" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps" "-L" "D:\mingw64\bin" "-L" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib" "-Wl,-Bstatic" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libcc-26f5897e987c513f.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libvcpkg-4e9d1e1cf024f287.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libpkg_config-eabf97f60e59e155.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libopencv_binding_generator-cf91a66c11e06f47.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libmaplit-89e4770a02e00683.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libregex-e1a2426ceba2c560.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libaho_corasick-8f8583e40eb0722e.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libmemchr-276da363a9dc7885.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libregex_syntax-7819ab6c9bd5c3b2.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libpercent_encoding-ba28f4b0ad3a7421.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libclang-6776bef641fcb7a5.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libclang_sys-ca676c954f055ab4.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\liblibc-4f95c6784b79ddf1.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libjobserver-a249a417fcfb792f.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libdunce-1eb41f323efb1649.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libshlex-1859469b97e90563.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libsemver-85abe38dea07595b.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libonce_cell-cd644079aa3256c7.rlib" "C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libglob-7fcbf81c878785ff.rlib" "-Wl,--start-group" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libstd-7959588b2c762305.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libpanic_unwind-522c3538829925d5.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libobject-084a152188b5f740.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libmemchr-808892e547be1112.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libaddr2line-88872107593ec46f.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libgimli-814103daf013b931.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libstd_detect-ea475a322644c790.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_demangle-7ec92043051d9764.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libhashbrown-5d56343a35e488e8.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_alloc-88a8fc2f8fd60ab4.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libunwind-76ea2b45ef5e7688.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libcfg_if-9b66d9a575c2147d.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\liblibc-5ef3559c9d5ebe68.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\liballoc-9ec3127520286a20.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_core-83da3e2b5a094024.rlib" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libcore-81d7bfd333b46cd2.rlib" "-Wl,--end-group" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-5171397674df0d2c.rlib" "-Wl,-Bdynamic" "-ladvapi32" "-lole32" "-loleaut32" "-lclang.dll" "-lkernel32" "-lws2_32" "-ladvapi32" "-luserenv" "-lkernel32" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib" "-o" "C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6\build_script_build-77ce32327bbc51d6.exe" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "D:\rust\lib\rustlib\x86_64-pc-windows-gnu\lib\rsend.o"
= note: d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lclang.dll
collect2.exe: error: ld returned 1 exit status
error: could not compile
opencv
due to previous errorCaused by:
process didn't exit successfully:
set CARGO=\\?\D:\rust\bin\cargo.exe&& set CARGO_CRATE_NAME=build_script_build&& set CARGO_MANIFEST_DIR=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\opencv-0.60.0&& set CARGO_PKG_AUTHORS="Pro <twisted.fall@gmail.com>:Mathieu Poumeyrol <kali@zoy.org>"&& 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_REPOSITORY=https://github.com/twistedfall/opencv-rust&& set CARGO_PKG_VERSION=0.60.0&& set CARGO_PKG_VERSION_MAJOR=0&& set CARGO_PKG_VERSION_MINOR=60&& set CARGO_PKG_VERSION_PATCH=0&& set CARGO_PKG_VERSION_PRE=""&& set PATH="C:\Users\user\Desktop\proj\rust\cv\target\debug\deps;D:\rust\bin;D:\powershell\7;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;D:\Git\cmd;D:\Git\mingw64\bin;D:\Git\usr\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\LLVM\bin;C:\Users\user\.cargo\bin;C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\user\AppData\Local\Programs\Python\Python39\;C:\Users\user\AppData\Local\Programs\Python\Launcher\;D:\mingw64\bin;C:\Users\user\AppData\Local\Microsoft\WindowsApps;D:\cmake\bin;D:\Microsoft VS Code\bin;D:\rust\bin;D:\opencv\mingw_build\bin"&& rustc --crate-name build_script_build --edition=2018 C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\opencv-0.60.0\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"alphamat\"" --cfg "feature=\"aruco\"" --cfg "feature=\"barcode\"" --cfg "feature=\"bgsegm\"" --cfg "feature=\"bioinspired\"" --cfg "feature=\"calib3d\"" --cfg "feature=\"ccalib\"" --cfg "feature=\"cudaarithm\"" --cfg "feature=\"cudabgsegm\"" --cfg "feature=\"cudacodec\"" --cfg "feature=\"cudafeatures2d\"" --cfg "feature=\"cudafilters\"" --cfg "feature=\"cudaimgproc\"" --cfg "feature=\"cudaobjdetect\"" --cfg "feature=\"cudaoptflow\"" --cfg "feature=\"cudastereo\"" --cfg "feature=\"cudawarping\"" --cfg "feature=\"cvv\"" --cfg "feature=\"default\"" --cfg "feature=\"dnn\"" --cfg "feature=\"dnn_superres\"" --cfg "feature=\"dpm\"" --cfg "feature=\"face\"" --cfg "feature=\"features2d\"" --cfg "feature=\"flann\"" --cfg "feature=\"freetype\"" --cfg "feature=\"fuzzy\"" --cfg "feature=\"gapi\"" --cfg "feature=\"hdf\"" --cfg "feature=\"hfs\"" --cfg "feature=\"highgui\"" --cfg "feature=\"img_hash\"" --cfg "feature=\"imgcodecs\"" --cfg "feature=\"imgproc\"" --cfg "feature=\"intensity_transform\"" --cfg "feature=\"line_descriptor\"" --cfg "feature=\"mcc\"" --cfg "feature=\"ml\"" --cfg "feature=\"objdetect\"" --cfg "feature=\"optflow\"" --cfg "feature=\"ovis\"" --cfg "feature=\"phase_unwrapping\"" --cfg "feature=\"photo\"" --cfg "feature=\"plot\"" --cfg "feature=\"quality\"" --cfg "feature=\"rapid\"" --cfg "feature=\"rgbd\"" --cfg "feature=\"saliency\"" --cfg "feature=\"sfm\"" --cfg "feature=\"shape\"" --cfg "feature=\"stereo\"" --cfg "feature=\"stitching\"" --cfg "feature=\"structured_light\"" --cfg "feature=\"superres\"" --cfg "feature=\"surface_matching\"" --cfg "feature=\"text\"" --cfg "feature=\"tracking\"" --cfg "feature=\"video\"" --cfg "feature=\"videoio\"" --cfg "feature=\"videostab\"" --cfg "feature=\"viz\"" --cfg "feature=\"wechat_qrcode\"" --cfg "feature=\"xfeatures2d\"" --cfg "feature=\"ximgproc\"" --cfg "feature=\"xobjdetect\"" --cfg "feature=\"xphoto\"" -C metadata=77ce32327bbc51d6 -C extra-filename=-77ce32327bbc51d6 --out-dir C:\Users\user\Desktop\proj\rust\cv\target\debug\build\opencv-77ce32327bbc51d6 -L dependency=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps --extern cc=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libcc-26f5897e987c513f.rlib --extern clang=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libclang-6776bef641fcb7a5.rlib --extern dunce=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libdunce-1eb41f323efb1649.rlib --extern glob=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libglob-7fcbf81c878785ff.rlib --extern jobserver=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libjobserver-a249a417fcfb792f.rlib --extern once_cell=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libonce_cell-cd644079aa3256c7.rlib --extern binding_generator=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libopencv_binding_generator-cf91a66c11e06f47.rlib --extern pkg_config=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libpkg_config-eabf97f60e59e155.rlib --extern semver=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libsemver-85abe38dea07595b.rlib --extern shlex=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libshlex-1859469b97e90563.rlib --extern vcpkg=C:\Users\user\Desktop\proj\rust\cv\target\debug\deps\libvcpkg-4e9d1e1cf024f287.rlib --cap-lints warn -L D:\mingw64\bin
(exit code: 1)The text was updated successfully, but these errors were encountered: