Open CG-SS opened 7 years ago
I have encountered this problem today, using VS 2017 and CUDA 9.0.
The actual problem is the first error MSB6006 which leads to the other LNK1104 errors. I searched in google and find this solution:
https://stackoverflow.com/questions/45918446/compiling-opencv-3-3-with-cuda-9-0rc
When using CMAKE to generate the project, change the CUDA_HOST_COMPILER parameter to:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe
The path of Visual Studio has changed in VS 2017 which leads to the errors.
This can solve most of problems you list, but some errors like: C2610, C2535, .etc still exists, but it seems affect only the performance tests. All OpenCV libraries are generated successfully and the INSTALL procedure also works fine.
With the latest Visual Studio the path for CUDA_HOST_COMPILER is C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx64/x64/cl.exe
Thanks ToDayL, that worked for me.
To add to this, you also need to append the bin/release directory to $PATH or make the .dll files local to python to avoid import errors for OpenCV Python, then you are all set.
I have a PR in, but setting your CUDA_HOST_COMPILER to this should work for any 2017 compiler (that CUDA supports)
$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)
what about A required dependency of the matlab module (Python Jinja2 package) was not found (installation command: "pip install jinja2"). Disabling Matlab bindings... ?
System information
CMake config output:
VS2017 build output log: