【发布时间】:2017-04-02 09:22:27
【问题描述】:
我一直在尝试在 opencv_contrib 中安装其他模块,但在尝试在 CMake 中进行配置时不断出错。
这些是我到目前为止所采取的步骤:
- 从 github 下载了 opencv 和 opencv_contrib。
- 将我想要的模块从 opencv_contrib 粘贴到 opencv/modules 中。
- 在 opencv 中创建了一个构建文件夹, seen here.
- 在 CMake gui 中,我将源代码设置为 C:/opencv-3.1.0-dev,并将构建文件夹设置为 C:/opencv-3.1.0-dev 中包含的构建文件夹。
- 按下配置后,我将项目的生成器设置为 Visual Studio 15。
- 我将本机 C 和 C++ 编译器指定为:
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
当我确认这一点并进行配置时,我收到此错误:
The CXX compiler identification is unknown
The C compiler identification is unknown
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
CMake Error: Generator: execution of make failed. Make command was: "MSBuild.exe" "cmTC_7c114.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake:44 (message):
The C++ compiler "C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/opencv-3.1.0-dev/build/CMakeFiles/CMakeTmp
Run Build Command:"MSBuild.exe" "cmTC_7c114.vcxproj"
"/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
Generator: execution of make failed. Make command was: "MSBuild.exe"
"cmTC_7c114.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:98 (project)
Configuring incomplete, errors occurred!
See also "C:/opencv-3.1.0-dev/build/CMakeFiles/CMakeOutput.log".
See also "C:/opencv-3.1.0-dev/build/CMakeFiles/CMakeError.log".
请有人解释一下如何解决这个问题,或者还有其他方法可以包含我需要的模块吗?
我环顾四周,有人建议以管理员身份运行 cl.exe,但这并没有解决问题。
【问题讨论】: