MSB6006 Error when building OpenCV from source in VS2015
I'm following the instructions here for compiling OpenCV 2.4.11 from source. I'm using Windows 7 and Visual Studio 2015.
I'm rebuilding from source using Visual Studio 2015 because of bizarre problems I'm experiencing with std::vector
deallocating improperly on my computer (See here).
The compilation always fails with a series of LNK1104 errors. However, I noticed that a small subset of the modules failed with a MSB6006 cmd.exe exited with code 1
error; when I try to compile these I get:
EDIT: The previous message was from a misconfiguration in which CUDA computing architecture I was using; I resolved the error and I am still getting a MSB6006
error:
------ Rebuild All started: Project: opencv_core, Configuration: Debug x64 ------
Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj
nvcc fatal : nvcc cannot find a supported version of Microsoft Visual Studio. Only the versions 2010, 2012, and 2013 are supported
CMake Error at cuda_compile_generated_matrix_operations.cu.obj.cmake:206 (message):
Error generating
C:/sdf3/opencv-2.4.11/vs2015-build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.
They seem to crash because Visual Studio 2015 isn't supported. What can I do to make VS2015 supported for building OpenCV?
thanks!
============================================================
UPDATE: I tried this with OpenCV 2.4.8, and I run into the same error.
============================================================
Original error message for future reference:
------ Rebuild All started: Project: opencv_core, Configuration: Debug x64 ------
Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj
nvcc fatal : Unsupported gpu architecture 'compute_11'
CMake Error at cuda_compile_generated_matrix_operations.cu.obj.cmake:206 (message):
Error generating
C:/sdf3/opencv-2.4.11/vs2015-build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.
Actually what the error says is that you are trying to build OpenCV with CUDA for the 1.1 compute capability, but your system doesn't have a graphics card with the capability and thus it crashes during built. Take your card ID and look up the compute capability at the NVIDIA Compute Capability website. Then set the correct value in CMAKE before running make.
I have a Geforce GTX 680, which as compatibility with 3.0. In CMake,
CUDA_ARCH_BIN
is set to3.0 3.5
andCUDA_ARCH_PTX
is blank. When I do that, it doesn't compile with a new message -- 'nvcc fatal : nvcc cannot find a supported version of Microsoft Visual Studio. Only the versions 2010, 2012, and 2013 are supported'