Ask Your Question

Revision history [back]

OpenCV 2.4.6 Build/link errors with CUDA and OpenGL

I'm getting the following build errors for OpenCV version 2.4.6 for "Visual Studio 10 Win64" with both WITH_OPENGL and WITH_OPENCV specified. Anyone know what I'm doing wrong?

Link Errors:

5>     Creating library C:/opencv/gpubuildwithopengl/lib/Debug/opencv_highgui246d.lib and object C:/opencv/gpubuildwithopengl/lib/Debug/opencv_highgui246d.exp
5>window.obj : error LNK2019: unresolved external symbol cvSetOpenGlDrawCallback referenced in function "void __cdecl cv::setOpenGlDrawCallback(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,void (__cdecl*)(void *),void *)" (?setOpenGlDrawCallback@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@P6AXPEAX@Z1@Z)
5>window.obj : error LNK2019: unresolved external symbol cvSetOpenGlContext referenced in function "void __cdecl cv::setOpenGlContext(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setOpenGlContext@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
5>window.obj : error LNK2019: unresolved external symbol cvUpdateWindow referenced in function "void __cdecl cv::updateWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?updateWindow@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
5>C:\opencv\gpubuildwithopengl\bin\Debug\opencv_highgui246d.dll : fatal error LNK1120: 3 unresolved externals

--

The OpenCV configuration is below:

CUDA detected: 5.5
CUDA NVCC target flags: -gencode;arch=compute_11,code=sm_11;-gencode;arch=compute_12,code=sm_12;-gencode;arch=compute_13,code=sm_13;-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_20,code=compute_20;-gencode;arch=compute_30,code=compute_30
Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 

General configuration for OpenCV 2.4.6 =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.1 AMD64
    CMake:                       2.8.11.2
    CMake generator:             Visual Studio 10 Win64
    CMake build tool:            c:/PROGRA~2/MICROS~2.0/Common7/IDE/devenv.com
    MSVC:                        1600

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe  (ver 16.0.40219.1)
    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 /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 /Oi  /wd4251 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  c:/Program Files (x86)/Microsoft Visual Studio 10.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 /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 /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 imgproc flann highgui features2d calib3d ml video objdetect contrib photo legacy gpu ocl nonfree stitching superres ts videostab
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 androidcamera java python

  GUI: 
    QT:                          NO
    Win32 UI:                    YES
    OpenGL support:              YES (glu32 opengl32)

  Media I/O: 
    ZLib:                        build (ver 1.2.7)
    JPEG:                        build (ver 62)
    PNG:                         build (ver 1.5.12)
    TIFF:                        build (ver 42 - 4.0.2)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 1.7.1)

  Video I/O:
    Video for Windows:           YES
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      YES (prebuilt binaries)
      codec:                     YES (ver 53.61.100)
      format:                    YES (ver 53.32.100)
      util:                      YES (ver 51.35.100)
      swscale:                   YES (ver 2.1.100)
      gentoo-style:              YES
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    DirectShow:                  YES
    Media Foundation:            NO
    XIMEA:                       NO

  Other third-party libraries:
    Use IPP:                     NO
    Use Eigen:                   NO
    Use TBB:                     NO
    Use OpenMP:                  NO
    Use GCD                      NO
    Use Concurrency              YES
    Use C=:                      NO
    Use Cuda:                    YES (ver 5.5)
    Use OpenCL:                  YES

  NVIDIA CUDA
    Use CUFFT:                   YES
    Use CUBLAS:                  YES
    USE NVCUVID:                 NO
    NVIDIA GPU arch:             11 12 13 20 21 30
    NVIDIA PTX archs:            20 30
    Use fast math:               NO

  OpenCL
    Include path:                C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.5/include
    libraries:                   C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.5/lib/x64/OpenCL.lib
    Use AMD FFT:                 NO
    Use AMD BLAS:                NO

  Python:
    Interpreter:                 C:/Python27/python.exe (ver 2.7.2)

  Java:
    ant:                         NO
    JNI:                         NO
    Java tests:                  NO

  Documentation:
    Build Documentation:         NO
    Sphinx:                      NO
    PdfLaTeX compiler:           NO

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

  Install path:                  C:/opencv/gpubuildwithopengl/install

  cvconfig.h is in:              C:/opencv/gpubuildwithopengl
-----------------------------------------------------------------

Configuring done
click to hide/show revision 2
retagged

updated 2013-10-10 14:37:08 -0600

berak gravatar image

OpenCV 2.4.6 Build/link errors with CUDA and OpenGL

I'm getting the following build errors for OpenCV version 2.4.6 for "Visual Studio 10 Win64" with both WITH_OPENGL and WITH_OPENCV specified. Anyone know what I'm doing wrong?

Link Errors:

5>     Creating library C:/opencv/gpubuildwithopengl/lib/Debug/opencv_highgui246d.lib and object C:/opencv/gpubuildwithopengl/lib/Debug/opencv_highgui246d.exp
5>window.obj : error LNK2019: unresolved external symbol cvSetOpenGlDrawCallback referenced in function "void __cdecl cv::setOpenGlDrawCallback(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,void (__cdecl*)(void *),void *)" (?setOpenGlDrawCallback@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@P6AXPEAX@Z1@Z)
5>window.obj : error LNK2019: unresolved external symbol cvSetOpenGlContext referenced in function "void __cdecl cv::setOpenGlContext(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setOpenGlContext@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
5>window.obj : error LNK2019: unresolved external symbol cvUpdateWindow referenced in function "void __cdecl cv::updateWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?updateWindow@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
5>C:\opencv\gpubuildwithopengl\bin\Debug\opencv_highgui246d.dll : fatal error LNK1120: 3 unresolved externals

--

The OpenCV configuration is below:

CUDA detected: 5.5
CUDA NVCC target flags: -gencode;arch=compute_11,code=sm_11;-gencode;arch=compute_12,code=sm_12;-gencode;arch=compute_13,code=sm_13;-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_20,code=compute_20;-gencode;arch=compute_30,code=compute_30
Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 

General configuration for OpenCV 2.4.6 =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.1 AMD64
    CMake:                       2.8.11.2
    CMake generator:             Visual Studio 10 Win64
    CMake build tool:            c:/PROGRA~2/MICROS~2.0/Common7/IDE/devenv.com
    MSVC:                        1600

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe  (ver 16.0.40219.1)
    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 /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 /Oi  /wd4251 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  c:/Program Files (x86)/Microsoft Visual Studio 10.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 /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 /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 imgproc flann highgui features2d calib3d ml video objdetect contrib photo legacy gpu ocl nonfree stitching superres ts videostab
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 androidcamera java python

  GUI: 
    QT:                          NO
    Win32 UI:                    YES
    OpenGL support:              YES (glu32 opengl32)

  Media I/O: 
    ZLib:                        build (ver 1.2.7)
    JPEG:                        build (ver 62)
    PNG:                         build (ver 1.5.12)
    TIFF:                        build (ver 42 - 4.0.2)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 1.7.1)

  Video I/O:
    Video for Windows:           YES
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      YES (prebuilt binaries)
      codec:                     YES (ver 53.61.100)
      format:                    YES (ver 53.32.100)
      util:                      YES (ver 51.35.100)
      swscale:                   YES (ver 2.1.100)
      gentoo-style:              YES
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    DirectShow:                  YES
    Media Foundation:            NO
    XIMEA:                       NO

  Other third-party libraries:
    Use IPP:                     NO
    Use Eigen:                   NO
    Use TBB:                     NO
    Use OpenMP:                  NO
    Use GCD                      NO
    Use Concurrency              YES
    Use C=:                      NO
    Use Cuda:                    YES (ver 5.5)
    Use OpenCL:                  YES

  NVIDIA CUDA
    Use CUFFT:                   YES
    Use CUBLAS:                  YES
    USE NVCUVID:                 NO
    NVIDIA GPU arch:             11 12 13 20 21 30
    NVIDIA PTX archs:            20 30
    Use fast math:               NO

  OpenCL
    Include path:                C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.5/include
    libraries:                   C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.5/lib/x64/OpenCL.lib
    Use AMD FFT:                 NO
    Use AMD BLAS:                NO

  Python:
    Interpreter:                 C:/Python27/python.exe (ver 2.7.2)

  Java:
    ant:                         NO
    JNI:                         NO
    Java tests:                  NO

  Documentation:
    Build Documentation:         NO
    Sphinx:                      NO
    PdfLaTeX compiler:           NO

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

  Install path:                  C:/opencv/gpubuildwithopengl/install

  cvconfig.h is in:              C:/opencv/gpubuildwithopengl
-----------------------------------------------------------------

Configuring done