opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.18k stars 5.73k forks source link

assert identifier not found #3540

Open meakcey opened 11 months ago

meakcey commented 11 months ago
System information (version)

I am having problem while compiling OpenCV 4.7 and 4.8 as assert identifier not found.

CMake configuration as below


Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
ocv_init_download: OpenCV source tree is not fetched as git repository. 3rdparty resources will be downloaded from github.com by default.
Detected processor: AMD64
libjpeg-turbo: VERSION = 2.1.3, BUILD = opencv-4.7.0-libjpeg-turbo
libjpeg-turbo(SIMD): SIMD extensions disabled: could not find NASM compiler.  Performance will suffer.
Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version >= 2.3.1). OpenJPEG will be built from sources
OpenJPEG: VERSION = 2.4.0, BUILD = opencv-4.7.0-openjp2-2.4.0
OpenJPEG libraries will be built from sources: libopenjp2 (version "2.4.0")
Found TBB (cmake): C:/Program Files (x86)/Intel/oneAPI/tbb/latest/redist/intel64/vc_mt/tbb12.dll
found Intel IPP (ICV version): 2020.0.0 [2020.0.0 Gold]
at: C:/OpenCV/build/3rdparty/ippicv/ippicv_win/icv
found Intel IPP Integration Wrappers sources: 2020.0.0
at: C:/OpenCV/build/3rdparty/ippicv/ippicv_win/iw
LAPACK(MKL): LAPACK_LIBRARIES: C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_intel_lp64.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_tbb_thread.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_core.lib;tbb
LAPACK(MKL): Support is enabled.
Found apache ant: C:/ant/bin/ant.bat (1.10.13)
Found VTK 9.2.6
freetype2:   NO
harfbuzz:    NO
Julia not found. Not compiling Julia Bindings. 
Module opencv_ovis disabled because OGRE3D was not found
CERES support is disabled. Ceres Solver for reconstruction API is required.
Tesseract:   NO
Allocator metrics storage type: 'long long'
Excluding from source files list: modules/imgproc/src/imgwarp.lasx.cpp
Excluding from source files list: modules/imgproc/src/resize.lasx.cpp
Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': C:/OpenCV/opencv-4.7.0/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
opencv_dnn: filter out cuda4dnn source code
Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.rvv.cpp
Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.lasx.cpp
Excluding from source files list: <BUILD>/modules/dnn/int8layers/layers_common.lasx.cpp
imgcodecs: OpenEXR codec is disabled in runtime. Details: https://github.com/opencv/opencv/issues/21326
highgui: using builtin backend: QT6
CERES support is disabled. Ceres Solver for reconstruction API is required.
Found 'misc' Python modules from C:/OpenCV/opencv-4.7.0/modules/python/package/extra_modules
Found 'mat_wrapper;utils' Python modules from C:/OpenCV/opencv-4.7.0/modules/core/misc/python/package
Found 'gapi' Python modules from C:/OpenCV/opencv-4.7.0/modules/gapi/misc/python/package
Found 'misc' Python modules from C:/OpenCV/opencv-4.7.0/modules/python/package/extra_modules
Found 'mat_wrapper;utils' Python modules from C:/OpenCV/opencv-4.7.0/modules/core/misc/python/package
Found 'gapi' Python modules from C:/OpenCV/opencv-4.7.0/modules/gapi/misc/python/package
CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
  CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
  directory
Call Stack (most recent call first):
  CMakeLists.txt:1059 (include)

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

  Extra modules:
    Location (extra):            C:/OpenCV/opencv_contrib-4.7.0/modules
    Version control (extra):     unknown

  Platform:
    Timestamp:                   2023-07-28T09:26:04Z
    Host:                        Windows 10.0.19045 AMD64
    CMake:                       3.26.4
    CMake generator:             Visual Studio 16 2019
    CMake build tool:            C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe
    MSVC:                        1929
    Configuration:               Debug Release

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (18 files):         + SSSE3 SSE4_1
      SSE4_2 (2 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (1 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (5 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (34 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
      AVX512_SKX (8 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

  C/C++:
    Built as dynamic libs?:      YES
    C++ standard:                11
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe  (ver 19.29.30151.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4819 /MP  /MD /O2 /Ob2 /DNDEBUG 
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4819 /MP  /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/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  /fp:precise     /MP   /MD /O2 /Ob2 /DNDEBUG 
    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  /fp:precise     /MP /MDd /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:x64  /NODEFAULTLIB:tbb12.lib /INCREMENTAL:NO 
    Linker flags (Debug):        /machine:x64  /NODEFAULTLIB:tbb12.lib /debug /INCREMENTAL 
    ccache:                      NO
    Precompiled headers:         YES
    Extra dependencies:
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 alphamat aruco barcode bgsegm bioinspired calib3d ccalib core cvv datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc intensity_transform java line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev freetype julia matlab ovis python2
    Applications:                tests perf_tests apps
    Documentation:               NO
    Non-free algorithms:         NO

  Windows RT support:            NO

  GUI:                           QT6
    QT:                          YES (ver 6.5.2 )
      QT OpenGL support:         NO
    Win32 UI:                    YES
    VTK support:                 YES (ver 9.2.6)

  Media I/O: 
    ZLib:                        build (ver 1.2.13)
    JPEG:                        build-libjpeg-turbo (ver 2.1.3-62)
      SIMD Support Request:      YES
      SIMD Support:              NO
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         build (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES (prebuilt binaries)
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                YES (4.0.0)
    GStreamer:                   YES (1.22.5)
    DirectShow:                  YES
    Media Foundation:            YES
      DXVA:                      YES

  Parallel framework:            TBB (ver 2021.10 interface 12100)

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2020.0.0 Gold [2020.0.0]
           at:                   C:/OpenCV/build/3rdparty/ippicv/ippicv_win/icv
    Intel IPP IW:                sources (2020.0.0)
              at:                C:/OpenCV/build/3rdparty/ippicv/ippicv_win/iw
    Lapack:                      YES (C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_intel_lp64.lib C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_tbb_thread.lib C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_core.lib tbb)
    Eigen:                       YES (ver ..)
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)

  OpenCL:                        YES (NVD3D11)
    Include path:                C:/OpenCV/opencv-4.7.0/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 C:/Python311/python.exe (ver 3.11.4)
    Libraries:                   optimized C:/Python311/libs/python311.lib debug C:/Python311/libs/python311_d.lib (ver 3.11.4)
    numpy:                       C:/Python311/Lib/site-packages/numpy/core/include (ver 1.24.3)
    install path:                C:/Python311/Lib/site-packages/cv2/python-3.11

  Python (for build):            C:/Python311/python.exe

  Java:                          
    ant:                         C:/ant/bin/ant.bat (ver 1.10.13)
    JNI:                         C:/Program Files/Eclipse Foundation/jdk-8.0.302.8-hotspot/include C:/Program Files/Eclipse Foundation/jdk-8.0.302.8-hotspot/include/win32 C:/Program Files/Eclipse Foundation/jdk-8.0.302.8-hotspot/include
    Java wrappers:               YES
    Java tests:                  YES

  Install to:                    C:/OpenCV/build/install
-----------------------------------------------------------------

Configuring done (27.3s)
Generating done (39.3s)

When I try to build as Release on VS2019, getting so many errors like below C3861 'assert':identifier not found through the projects numeric, multiview

If I manually add

include

that is getting resolved for related project but I think it is more general problem.

I would be glad if anyone can help.

LaurentBerger commented 11 months ago

disable sfm module or update to 4.8

meakcey commented 11 months ago

i am having the same problem with 4.8 too

LaurentBerger commented 11 months ago

disable sfm module

meakcey commented 11 months ago

disabling sfm seems worked i have missed the ceres solver needed for sfm thank you

asmorkalov commented 11 months ago

Moved to opencv_contrib as it's related to sfm.

LaurentBerger commented 11 months ago

@meakcey you must not copy opencv_contrib in opencv folder. Contrib modules are under constant development and it is recommended to use them alongside the master branch or latest releases of OpenCV.