Repository: opencv
Issue: Build error on Windows when CUDA is disabled
Labels: bug,auto-transferred,priority: normal,category: build/install,affected: 3.4

Transferred from http://code.opencv.org/issues/3830

```
|| Erfan Noury on 2014-07-26 12:19
|| Priority: Normal
|| Affected: branch 'master' (3.0-dev)
|| Category: build/install
|| Tracker: Bug
|| Difficulty: 
|| PR: 
|| Platform: x64 / Windows
```
## Build error on Windows when CUDA is disabled

```
I'm on Windows 8.1 x64 with CUDA 6.0 and VS2013 installed, but since CUDA 6.0 doesn't have compatibility with VS2013, I disabled CUDA in CMake configuration.
Problem is, when trying to build Opencv,I get link error in Visual Studio, since projects are linked against CUDA libraries.
Here is my CMake output:
<pre>
Checking for Windows Platform SDK
Checking for Visual Studio 2012
Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) 

General configuration for OpenCV 3.0.0-dev =====================================
  Version control:               2.4.9-4346-gda1ac35-dirty

  Platform:
    Host:                        Windows 6.2 AMD64
    CMake:                       2.8.12.1
    CMake generator:             Visual Studio 12 Win64
    CMake build tool:            C:/PROGRA~2/MSBuild/12.0/Bin/MSBuild.exe
    MSVC:                        1800

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe  (ver 18.0.30501.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:AVX /Oi  /wd4251 /MD /O2 /Ob2 /D NDEBUG  /Zi
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:AVX /Oi  /wd4251 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:AVX /Oi  /MD /O2 /Ob2 /D NDEBUG  /Zi
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:AVX /Oi  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:x64   /INCREMENTAL:NO  /debug
    Linker flags (Debug):        /machine:x64   /debug /INCREMENTAL 
    Precompiled headers:         YES

  OpenCV modules:
    To be built:                 core flann imgproc imgcodecs videoio highgui features2d calib3d ml nonfree objdetect optim photo video shape stitching superres ts videostab
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 androidcamera cuda cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaoptflow cudastereo cudawarping cudev java matlab viz

  Windows RT support:            NO

  GUI: 
    QT:                          NO
    Win32 UI:                    YES
    OpenGL support:              NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.2.8)
    JPEG:                        build (ver 90)
    WEBP:                        NO
    PNG:                         build (ver 1.5.12)
    TIFF:                        build (ver 42 - 4.0.2)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     NO

  Video I/O:
    Video for Windows:           YES
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      YES (prebuilt binaries)
      codec:                     YES (ver 55.18.102)
      format:                    YES (ver 55.12.100)
      util:                      YES (ver 52.38.100)
      swscale:                   YES (ver 2.3.100)
      gentoo-style:              YES
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    OpenNI2:                     NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    DirectShow:                  YES
    Media Foundation:            YES
    XIMEA:                       NO
    Intel PerC:                  NO

  Other third-party libraries:
    Use IPP:                     NO
    Use IPP Async:               NO
    Use Eigen:                   YES (ver 3.2.1)
    Use TBB:                     YES (ver 4.2 interface 7005)
    Use OpenMP:                  NO
    Use GCD                      NO
    Use Concurrency              NO
    Use C=:                      NO
    Use Cuda:                    NO
    Use OpenCL:                  NO

  Python:
    Interpreter:                 C:/Anaconda/python.exe (ver 2.7.6)

  Java:
    ant:                         NO
    JNI:                         C:/Program Files/Java/jdk1.8.0_05/include C:/Program Files/Java/jdk1.8.0_05/include/win32 C:/Program Files/Java/jdk1.8.0_05/include
    Java tests:                  NO

  Matlab:
    mex:                         NO

  Tests and samples:
    Tests:                       NO
    Performance tests:           YES
    C/C++ Examples:              NO
</pre>

And this is the error inside Visual Studio:
<pre>
error LNK1104: cannot open file 'opencv_cudev.lib'  opencv_core
</pre>
```
## History