我正在尝试使用contrib模块和cuda启用构建OpenCV 4.01。以下是cmake配置的摘要
OpenCV modules:
To be built: calib3d core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev dnn dnn_objdetect features2d flann fuzzy gapi hfs highgui imgcodecs imgproc java_bindings_generator line_descriptor ml objdetect optflow phase_unwrapping photo python2 python3 python_bindings_generator shape stitching structured_light superres ts video videoio videostab xfeatures2d ximgproc xobjdetect
Disabled: world
Disabled by dependency: -
Unavailable: cnn_3dobj java js
Applications: tests perf_tests examples apps
Documentation: NO
Non-free algorithms: NO
Windows RT support: NO
GUI:
QT: YES (ver 5.7.0)
QT OpenGL support: NO
Win32 UI: YES
VTK support: NO
Media I/O:
ZLib: build (ver 1.2.11)
JPEG: build-libjpeg-turbo (ver 1.5.3-62)
WEBP: build (ver encoder: 0x020e)
PNG: build (ver 1.6.35)
TIFF: build (ver 42 - 4.0.9)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES
Video I/O:
DC1394: NO
FFMPEG: YES (prebuilt binaries)
avcodec: YES (ver 58.35.100)
avformat: YES (ver 58.20.100)
avutil: YES (ver 56.22.100)
swscale: YES (ver 5.3.100)
avresample: YES (ver 4.0.0)
GStreamer: NO
DirectShow: YES
Media Foundation: YES
DXVA: YES
Parallel framework: Concurrency
Trace: YES (with Intel ITT)
Other third-party libraries:
Intel IPP: 2019.0.0 Gold [2019.0.0]
at: C:/opencv-4.0.1/cmake-build/3rdparty/ippicv/ippicv_win/icv
Intel IPP IW: sources (2019.0.0)
at: C:/opencv-4.0.1/cmake-build/3rdparty/ippicv/ippicv_win/iw
Lapack: NO
Eigen: NO
Custom HAL: NO
Protobuf: build (3.5.1)
NVIDIA CUDA: YES (ver 8.0, CUFFT CUBLAS NVCUVID)
NVIDIA GPU arch: 20 30 35 37 50 52 60 61
NVIDIA PTX archs:
OpenCL: YES (no extra features)
Include path: E:/In-Field-Sorting-Pro/OpenCV/opencv-4.0.1-vc14_vc15/opencv/sources/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
Python 2:
Interpreter: C:/Users/FLab/Anaconda2/python.exe (ver 2.7.14)
Libraries: C:/Users/FLab/Anaconda2/libs/python27.lib (ver 2.7.14)
numpy: C:/Users/FLab/Anaconda2/lib/site-packages/numpy/core/include (ver 1.13.3)
install path: C:/Users/FLab/Anaconda2/Lib/site-packages/cv2/python-2.7
Python 3:
Interpreter: C:/Python35/python3.exe (ver 3.5.4)
Libraries: C:/Python35/libs/python35.lib (ver 3.5.4)
numpy: C:/Python35/lib/site-packages/numpy/core/include (ver 1.13.1)
install path: C:/Python35/Lib/site-packages/cv2/python-3.5
Python (for build): C:/Users/FLab/Anaconda2/python.exe
Java:
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO
Install to: C:/opencv-4.0.1/mybuild
-----------------------------------------------------------------
此构建处理会在构建样本中产生许多LNK1104 cannot open file
错误,如下所示(部分错误):
Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) pca C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Warning C4838 conversion from 'int' to 'float' requires a narrowing conversion opencv_highgui E:\In-Field-Sorting-Pro\OpenCV\opencv-4.0.1-vc14_vc15\opencv\sources\modules\highgui\src\window_QT.cpp 106
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) inpaint C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) kalman C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) kmeans C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) laplace C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) letter_recog C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) lkdemo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) logistic_regression C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) lsd_lines C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) mask_tmpl C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) matchmethod_orb_akaze_brisk C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) minarea C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) morphology2 C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) neural_network C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) npr_demo (samples\cpp\(sample) npr_demo) C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) opencv_version C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) peopledetect C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) phase_corr C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) points_classifier C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) polar_transforms C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) qrcode C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) segment_objects C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) select3dobj C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) smiledetect C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) squares (samples\cpp\(sample) squares) C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) stereo_calib C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) stereo_match (samples\cpp\(sample) stereo_match) C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) stitching C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) stitching_detailed C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) train_HOG C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) train_svmsgd C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) travelsalesman C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) tree_engine C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videocapture_basic C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videocapture_camera C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videocapture_gphoto2_autofocus C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videocapture_gstreamer_pipeline C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videocapture_image_sequence C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videocapture_intelperc C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videocapture_openni C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videocapture_starter C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) videowriter_basic C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) warpPerspective_demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) watershed C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) alpha_comp C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) bgfg_segm (samples\gpu\(sample) bgfg_segm) C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) cascadeclassifier C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) farneback_optical_flow C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) generalized_hough C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) hog (samples\gpu\(sample) hog) C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) houghlines (samples\gpu\(sample) houghlines) C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) morphology C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) multi C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) optical_flow C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) pyrlk_optical_flow (samples\gpu\(sample) pyrlk_optical_flow) C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) stereo_match (samples\gpu\(sample) stereo_match) C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) stereo_multi C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) super_resolution C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) surf_keypoint_matcher C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) video_reader C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_superres401d.lib' (sample) video_writer C:\opencv-4.0.1\cmake-build\samples\gpu\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) AKAZE_match C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) AddingImages C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) AddingImagesTrackbar C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) BasicLinearTransforms C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) BasicLinearTransformsTrackbar C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) CannyDetector_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Drawing_1 C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Drawing_2 C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) EqualizeHist_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Geometric_Transforms_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) HitMiss C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) HoughCircle_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) HoughLines_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) LATCH_match C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Laplace_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) MatchTemplate_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Morphology_1 C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Morphology_2 C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Morphology_3 C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Pyramids C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Remap_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) SURF_FLANN_matching_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) SURF_FLANN_matching_homography_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) SURF_detection_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) SURF_matching_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Smoothing C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Sobel_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Threshold C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) Threshold_inRange C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) anisotropic_image_segmentation C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) bg_sub C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) calcBackProject_Demo1 C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) calcBackProject_Demo2 C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) calcHist_Demo C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) camera_calibration C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_cudaobjdetect401d.lib' (sample) changing_contrast_brightness_image C:\opencv-4.0.1\cmake-build\samples\cpp\LINK 1
...................................
我正在考虑重建OpenCV(对cmake配置进行了一些修改)。任何人都有类似的经历吗?是什么导致LNK错误,以及如何解决这些错误?