使用 IE(推理引擎)编译时 OpenCV 构建错误

OpenCV build error while compiling with IE (Inference Engine)

OpenCV版本:4.4.0(最新) OpenVINO 版本:2020.4(最新)

试图在 Windows 10 上构建由 CMake 3.18.0 生成的项目时发生错误。 试了很多次从头开始构建(清除所有缓存,更新源码,重装OpenVINO工具包,运行全部demo成功),问题依旧

这是 VS 2019 构建错误日志:

46>Done building project "opencv_dnn.vcxproj" -- FAILED.

73>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_dnn440.lib'
75>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_dnn440.lib'
73>Done building project "opencv_text.vcxproj" -- FAILED.
81>------ Build started: Project: opencv_datasets, Configuration: Release x64 ------
82>------ Build started: Project: opencv_videostab, Configuration: Release x64 ------
75>Done building project "opencv_mcc.vcxproj" -- FAILED.

81>Done building project "opencv_datasets.vcxproj" -- FAILED.

88>Done building project "opencv_dnn_objdetect.vcxproj" -- FAILED.

87>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_datasets440.lib'
87>Done building project "opencv_tracking.vcxproj" -- FAILED.

94>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_tracking440.lib'
94>Done building project "opencv_stereo.vcxproj" -- FAILED.
95>cv2.cpp
95>D:\GitHub\opencv\opencv_contrib\modules\saliency\include\opencv2/saliency/saliencySpecializedClasses.hpp(1,1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
95>D:\GitHub\opencv\opencv_contrib\modules\datasets\include\opencv2/datasets/dataset.hpp(1,1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
93>LINK : fatal error LNK1181: cannot open input file '..\..\..\lib\Release\opencv_tracking440.lib'
93>Done building project "opencv_java.vcxproj" -- FAILED.
95>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_dnn_superres440.lib'
95>Done building project "opencv_python3.vcxproj" -- FAILED.
96>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
96>Building Custom Rule D:/GitHub/opencv/opencv/CMakeLists.txt

最后 10 个失败:

========== 构建:86 次成功,10 次失败,0 次更新,0 次跳过 ==========

注意:之前我可以使用 IE 构建 OpenCV 没有任何错误,但在新版本中编译和构建时出现很多错误。

有解决办法吗?

如果需要,我准备提供更多日志和信息。

谢谢!!

问题已通过使用 ngraph 标志配置 CMake 并定位其 CMake 文件 DIR 位置来解决。