I had difficulties building from the opencv + CUDA source code for c++.
I do everything according to this guide. Build OpenCV (including Python) with CUDA on Windows: Comprehensive Guide including Python Bindings, cuDNN, and Nvidia Video Codec SDK .
I’m writing this command in cmake “cmake -S C:\libs\opencv-4.5.2 -B C:\libs\build -D OPENCV_EXTRA_MODULES_PATH=C:\lib\opencv_contrib4x\modules -DCMAKE_BUILD_TYPE=Release -DWITH_CUDA=ON -DOPENCV_DNN_CUDA=ON -DOPENCV_DNN_OPENCL=ON -DBUILD_opencv_dnn=ON -DENABLE_FAST_MATH=ON -DBUILD_opencv_world=ON”
But for some reason, the opencv_world file is missing in the final build\install\lib, although it should be. Also, when building a project through Visual Studio, a linking error is displayed " 120>LINK : fatal error LNK1104: unable to open the file “…..\lib\Debug\opencv_world452d.lib”
120>The build of the project “opencv_perf_cudafeatures2d.vcxaview” has been completed with an error.
"
NVIDIA CUDA: YES (ver 12.8, CUFFT CUBLAS)
NVIDIA GPU arch: 50 52 60 61 70 75 80 86
I have a little snag, like in that topic. Missing lib files while building with Visual Studio 2022 - #5 by cudawarped .
CUDA Version 12.8
Visual Studio 2022
Errors when building INSTALL in visual studio
C:\libs\opencv-4.5.2\3rdparty\protobuf\src\google\protobuf\stubs\hash.h (241,22): error C2504: hash_compare: base class not defined
6>(copy of the outgoing file “…/…/…/opencv-4.5.2/3rdparty/protobuf/src/google/protobuf/reflection_ops.cc”)
6>C:\libs\opencv-4.5.2\3rdparty\protobuf\src\google\protobuf\map_field.h (817.48): error C2064: the argument is not repeated, it accepts 1 argument
6>(a copy of the outgoing file “…/…/…/opencv-4.5.2/3rdparty/protobuf/src/google/protobuf/reflection_ops.cc”)
How can this be fixed?