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

Fails to link any program using opencv due to multiple missing dependencies #161

Closed
unjello opened this issue Aug 6, 2020 · 9 comments
Closed

Comments

@unjello
Copy link

unjello commented Aug 6, 2020

I am unable to produce a binary using opencv-rust, due to linkage errors as below.

  1. Operating system

Windows 10 19041.421

  1. The way you installed OpenCV: package, official binary distribution, manual compilation, etc.

vpkg install opencv[contrib,cuda,dnn,ffmpeg,jpeg,nonfree,opengl,png,tiff,webp]:x64-windows-static-md

  1. OpenCV version

opencv4:x64-windows-static-md 4.3.0 computer vision library

Cuda is also installed as a dependency, automatically by vcpkg:

cuda:x64-windows-static-md                         10.1#2           A parallel computing platform and programming model
cudnn:x64-windows-static-md                        7.6#2            NVIDIA's cuDNN deep neural network acceleration ...
  1. Attach the full output of the following command from your project directory:
    There's multiple dependencies missing for cuda, native windows (tls, bcrypt, win32 windows), and in protobuf (dnn component of opencv depends on it) too.

Full log here:
https://gist.github.com/unjello/93b3f7ff8d7ee092e426c98e2a03d2f0

@unjello unjello changed the title Fails to link any program using opencv due to missing CUDA dependencies and TLS Fails to link any program using opencv due to multiple missing dependencies Aug 6, 2020
@twistedfall
Copy link
Owner

Hi, I'd like to see the full build log as you get it when you run cargo build -vv

@unjello
Copy link
Author

unjello commented Aug 6, 2020

Hi, thanks for getting back. I've updated the gist to show the full log.

@twistedfall
Copy link
Owner

I think that the last lines of the log are cut out, I can't see the linking error anymore

@unjello
Copy link
Author

unjello commented Aug 6, 2020

Yes, the gist does truncate the output. Here's the link to full raw (you can find it at the top of initial screen too):
https://gist.githubusercontent.com/unjello/93b3f7ff8d7ee092e426c98e2a03d2f0/raw/8170e475dbd529e02c84a2f0fcc45da8287081ca/gistfile1.txt

@twistedfall
Copy link
Owner

Are you using a nightly compiler? If so which particular version? Can you try with a stable Rust? 1.45.2 that is

@unjello
Copy link
Author

unjello commented Aug 6, 2020

FWIW, I just dig through docs enough to find $env:VCPKGRS_DYNAMIC="True" and when it picks x64-windows triplet instead of x64-windows-static-md it works. All compiles successfuly.

And I'm using:

PS> rustc --version
rustc 1.47.0-nightly (f9d422ea7 2020-08-04)

@twistedfall
Copy link
Owner

Ah, I'm going to update the troubleshooting guide with that info, thanks!

@unjello
Copy link
Author

unjello commented Aug 6, 2020

I am not sure if it's not closed too early. Static linking would me more idiomatic for rust. But that also may be vcpkg crate issue.

@twistedfall
Copy link
Owner

Well, for static linking the is a separate issue: #104 but so far I haven't investigated that. It would definitely be good to have such option.

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