mingw下编译opencv4.5.2

news2025/1/19 8:06:34

初衷:

加载之前的模型没问题,但最近加载另一个模型时出现报错:

OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.1.0) Error: Assertion failed (nodesMapIt != nodesMap.end()) in sortByExecutionOrder, file G:/MXCwork/2019/opencv4.1.0/opencv-4.1.0/modules/dnn/src/tensorflow/tf_graph_simplifier.cpp, line 860

在ubuntu上试过4.5.2加载模型没问题,于是重新编译mingw32的opencv4.5.2,配置如下:

mingw:4.9.2_32bit,同时设置好环境变量G:\QT\qt\Tools\MinGW_4.9.2\MinGW\bin

系统:windows10

opencv:4.5.2

一、github下载opencv源码

在源码中新建将build的文件夹如下:

注意contrib也要下对应版本https://github.com/opencv/opencv_contrib

二、打开cmake-gui

然后选择generator是MingW Makefiles,然后specify native compilers的C和C++处分别填写G:\QT\qt\Tools\MinGW_4.9.2\MinGW\bin\gcc.exe 以及G:\QT\qt\Tools\MinGW_4.9.2\MinGW\bin\g++.exe然后点击configure

三、手动下载必须的包

在第一次configure过程中可能有红色报错,不用在意。第一遍configure结束后按自己的需求取消或增加勾选项,比如我不用OpenCL我就将相关的全部取消,我还取消了OPENCV_GENERATE_SETUPVARS,并填写:

 然后开始第二次configure,在这个过程中要关注输出,当出现红色报错,如下应立刻将https://download.csdn.net/download/wd1603926823/88651377 的包拷贝或替换到opencv4.5.2下的.cache文件夹下的对应文件夹下,此时你替换时应该也看到系统正在下载同名的文件,但因网络问题很可能下载不全,所以建议直接全部替换:

接着开始第三次configure,此时我的只报了下图一个错,但我忽略了:

最后generate 

Detected processor: AMD64
sizeof(void) = 4 on 64 bit processor. Assume 32-bit compilation mode
libjpeg-turbo: VERSION = 2.0.6, BUILD = opencv-4.5.2-libjpeg-turbo
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.5.2-openjp2-2.4.0
OpenJPEG libraries will be built from sources: libopenjp2 (version "2.4.0")
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
Could NOT find BLAS (missing: BLAS_LIBRARIES) 
Could NOT find LAPACK (missing: LAPACK_LIBRARIES) 
    Reason given by package: LAPACK could not be found because dependency BLAS could not be found.

VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
OpenCV Python: during development append to PYTHONPATH: G:/workspace/opencv-4.5.2/mingw4.9.2_32bit_build/python_loader
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
Module opencv_alphamat disabled because the following dependencies are not found: Eigen
freetype2:   NO
harfbuzz:    NO
Julia not found. Not compiling Julia Bindings. 
Module opencv_ovis disabled because OGRE3D was not found
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
Tesseract:   NO
Processing WORLD modules...
    module opencv_core...
Consider adding OPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int/int64_t according to your build configuration
    module opencv_flann...
    module opencv_imgproc...
    module opencv_intensity_transform...
    module opencv_ml...
    module opencv_phase_unwrapping...
    module opencv_photo...
    module opencv_plot...
    module opencv_quality...
    module opencv_reg...
    module opencv_surface_matching...
    module opencv_xphoto...
    module opencv_dnn...
Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': G:/workspace/opencv-4.5.2/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
opencv_dnn: filter out ocl4dnn source code
opencv_dnn: filter out cuda4dnn source code
    module opencv_dnn_superres...
    module opencv_features2d...
    module opencv_fuzzy...
    module opencv_hfs...
    module opencv_imgcodecs...
    module opencv_line_descriptor...
    module opencv_saliency...
    module opencv_text...
    module opencv_videoio...
    module opencv_calib3d...
    module opencv_datasets...
    module opencv_highgui...
    module opencv_mcc...
    module opencv_objdetect...
    module opencv_rapid...
    module opencv_rgbd...
rgbd: Eigen support is disabled. Eigen is Required for Posegraph optimization
    module opencv_shape...
    module opencv_structured_light...
    module opencv_video...
    module opencv_videostab...
    module opencv_wechat_qrcode...
    module opencv_xfeatures2d...
xfeatures2d/boostdesc: Download: boostdesc_bgm.i
xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
xfeatures2d/vgg: Download: vgg_generated_48.i
    module opencv_ximgproc...
    module opencv_xobjdetect...
    module opencv_aruco...
    module opencv_bgsegm...
    module opencv_bioinspired...
    module opencv_ccalib...
    module opencv_dnn_objdetect...
    module opencv_dpm...
    module opencv_face...
data: Download: face_landmark_model.dat
    module opencv_gapi...
    module opencv_optflow...
    module opencv_stitching...
    module opencv_superres...
    module opencv_tracking...
    module opencv_stereo...
Processing WORLD modules... DONE
Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
Excluding from source files list: <BUILD>/modules/world/layers/layers_common.avx2.cpp
Excluding from source files list: <BUILD>/modules/world/layers/layers_common.avx512_skx.cpp
Excluding from source files list: modules/features2d/src/fast.avx2.cpp
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:1010 (include)



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

  Extra modules:
    Location (extra):            G:/workspace/opencv-4.5.2/opencv_contrib-4.x/modules
    Version control (extra):     unknown

  Platform:
    Timestamp:                   2023-12-21T03:10:16Z
    Host:                        Windows 10.0.18363 AMD64
    CMake:                       3.24.2
    CMake generator:             MinGW Makefiles
    CMake build tool:            G:/QT/qt/Tools/MinGW_4.9.2/MinGW/bin/mingw32-make.exe
    Configuration:               Release

  CPU/HW features:
    Baseline:                    SSE SSE2
      requested:                 SSE2
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX
      requested:                 SSE4_1 SSE4_2 AVX FP16
      SSE4_1 (15 files):         + SSE3 SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (0 files):            + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (4 files):             + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX

  C/C++:
    Built as dynamic libs?:      YES
    C++ standard:                11
    C++ Compiler:                G:/QT/qt/Tools/MinGW_4.9.2/MinGW/bin/g++.exe  (ver 4.9.2)
    C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Wno-delete-non-virtual-dtor -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Wno-delete-non-virtual-dtor -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  G:/QT/qt/Tools/MinGW_4.9.2/MinGW/bin/gcc.exe
    C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wuninitialized -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wuninitialized -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,--gc-sections  
    Linker flags (Debug):        -Wl,--gc-sections  
    ccache:                      NO
    Precompiled headers:         NO
    Extra dependencies:
    3rdparty dependencies:

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

  Windows RT support:            NO

  GUI: 
    Win32 UI:                    YES
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.2.11)
    JPEG:                        build-libjpeg-turbo (ver 2.0.6-62)
    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.91.100)
      avformat:                  YES (58.45.100)
      avutil:                    YES (56.51.100)
      swscale:                   YES (5.7.100)
      avresample:                YES (4.0.0)
    GStreamer:                   NO
    DirectShow:                  NO

  Parallel framework:            none

  Trace:                         YES (built-in)

  Other third-party libraries:
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)

  Python 3:
    Interpreter:                 F:/windows_wd/AI/python/py/python.exe (ver 3.6.7)
    Libraries:                   F:/windows_wd/AI/python/py/libs/libpython36.a (ver 3.6.7)
    numpy:                       F:/windows_wd/AI/python/py/lib/site-packages/numpy/core/include (ver 1.19.5)
    install path:                F:/windows_wd/AI/python/py/Lib/site-packages/cv2/python-3.6

  Python (for build):            F:/windows_wd/AI/python/py/python.exe

  Java:                          
    ant:                         NO
    JNI:                         G:/QT/jdk/include G:/QT/jdk/include/win32 G:/QT/jdk/include
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    G:/workspace/opencv-4.5.2/mingw4.9.2_32bit_build/install
-----------------------------------------------------------------

Configuring done
Generating done

 然后关闭cmake-gui!

四、开始编译

cmd或git-bash下进入G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build里,输入mingw32-make

1、ade出现下面的报错:

[  2%] Built target libopenjp2
[  2%] Built target opencv_videoio_plugins
[  2%] Building CXX object modules/CMakeFiles/ade.dir/__/3rdparty/ade/ade-0.1.1f/sources/ade/source/alloc.cpp.obj
G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build\3rdparty\ade\ade-0.1.1f\sources\ade\source\alloc.cpp: In function 'void* ade::aligned_alloc(std::size_t, std::size_t)':
G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build\3rdparty\ade\ade-0.1.1f\sources\ade\source\alloc.cpp:26:43: error: '_aligned_malloc' was not declared in this scope
     return _aligned_malloc(size, alignment);
                                           ^
G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build\3rdparty\ade\ade-0.1.1f\sources\ade\source\alloc.cpp: In function 'void ade::aligned_free(void*)':
G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build\3rdparty\ade\ade-0.1.1f\sources\ade\source\alloc.cpp:40:29: error: '_aligned_free' was not declared in this scope
     return _aligned_free(ptr);
                             ^
G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build\3rdparty\ade\ade-0.1.1f\sources\ade\source\alloc.cpp:40:29: error: return-statement with a value, in function returning 'void' [-fpermissive]
G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build\3rdparty\ade\ade-0.1.1f\sources\ade\source\alloc.cpp: In function 'void* ade::aligned_alloc(std::size_t, std::size_t)':
G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build\3rdparty\ade\ade-0.1.1f\sources\ade\source\alloc.cpp:35:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus.exe: some warnings being treated as errors
modules\CMakeFiles\ade.dir\build.make:75: recipe for target 'modules/CMakeFiles/ade.dir/__/3rdparty/ade/ade-0.1.1f/sources/ade/source/alloc.cpp.obj' failed
mingw32-make[2]: *** [modules/CMakeFiles/ade.dir/__/3rdparty/ade/ade-0.1.1f/sources/ade/source/alloc.cpp.obj] Error 1
CMakeFiles\Makefile2:2472: recipe for target 'modules/CMakeFiles/ade.dir/all' failed
mingw32-make[1]: *** [modules/CMakeFiles/ade.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

解决办法:打开cmake-gui,这时默认就是我们之前勾选的界面,取消掉与ade有关的东西,最好不用的东西都取消掉。然后configure再generate,然后关闭cmake-gui。最后进入G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build 依旧输入mingw32-make

2,io_win32出现如下报错:

[  2%] Built target libopenjp2
[  2%] Built target opencv_videoio_plugins
[  3%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj
G:\workspace\opencv-4.5.2\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc: In function 'FILE* google::protobuf::internal::win32::fopen(const char*, const char*)':
G:\workspace\opencv-4.5.2\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:330:10: error: '::_wfopen' has not been declared
   return ::_wfopen(wpath.c_str(), wmode.c_str());
          ^
G:\workspace\opencv-4.5.2\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:334:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus.exe: some warnings being treated as errors
3rdparty\protobuf\CMakeFiles\libprotobuf.dir\build.make:285: recipe for target '3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj' failed
mingw32-make[2]: *** [3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj] Error 1
CMakeFiles\Makefile2:2375: recipe for target '3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all' failed
mingw32-make[1]: *** [3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

 参考c++ - OpenCV : io_win32.cc : _wfopen has not been declared MinGW - Stack Overflow,我是修改G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build中的CMakeCache.txt,查找CMAKE_CXX_FLAGS,然後把CMAKE_CXX_FLAGS:STRING的值修改爲-U__STRICT_ANSI__
如下图:

 然后直接重新mingw32-make

3,webp出现报错如下:

[ 14%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/thread_utils.c.obj
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c:29:9: error: unknown type name 'CONDITION_VARIABLE'
 typedef CONDITION_VARIABLE pthread_cond_t;
         ^
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c: In function 'pthread_mutex_init':
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c:108:3: warning: implicit declaration of function 'InitializeCriticalSectionEx' [-Wimplicit-function-declaration]
   InitializeCriticalSectionEx(mutex, 0 /*dwSpinCount*/, 0 /*Flags*/);
   ^
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c: In function 'pthread_cond_init':
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c:146:3: warning: implicit declaration of function 'InitializeConditionVariable' [-Wimplicit-function-declaration]
   InitializeConditionVariable(condition);
   ^
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c: In function 'pthread_cond_signal':
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c:164:3: warning: implicit declaration of function 'WakeConditionVariable' [-Wimplicit-function-declaration]
   WakeConditionVariable(condition);
   ^
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c: In function 'pthread_cond_wait':
G:\workspace\opencv-4.5.2\3rdparty\libwebp\src\utils\thread_utils.c:182:3: warning: implicit declaration of function 'SleepConditionVariableCS' [-Wimplicit-function-declaration]
   ok = SleepConditionVariableCS(condition, mutex, INFINITE);
   ^
3rdparty\libwebp\CMakeFiles\libwebp.dir\build.make:1755: recipe for target '3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/thread_utils.c.obj' failed
mingw32-make[2]: *** [3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/thread_utils.c.obj] Error 1
CMakeFiles\Makefile2:2297: recipe for target '3rdparty/libwebp/CMakeFiles/libwebp.dir/all' failed
mingw32-make[1]: *** [3rdparty/libwebp/CMakeFiles/libwebp.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

 打开cmake-gui,这是上次的默认界面,直接取消webp相关的东西,即取消 BUILD_WEBP WITH_WEBP,(然后configure再generate,然后关闭cmake-gui,最后进入G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build 依旧输入mingw32-make ,这一段话我后面不再赘述,记住反正每次编译报错时,来取消某些选项后,都得这样做)

4,fibersapi出现报错:

[ 26%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/core/src/mathfuncs_core.dispatch.cpp.obj
[ 26%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/core/src/matmul.dispatch.cpp.obj
[ 26%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/core/src/matrix.cpp.obj
In file included from G:/workspace/opencv-4.5.2/modules/core/include/opencv2/core.hpp:53:0,
                 from G:/workspace/opencv-4.5.2/modules/core/include/opencv2/core/utility.hpp:56,
                 from G:\workspace\opencv-4.5.2\modules\core\src\precomp.hpp:53,
                 from G:\workspace\opencv-4.5.2\modules\core\src\matrix.cpp:5:
G:\workspace\opencv-4.5.2\modules\core\src\matrix.cpp: In function 'void cv::setSize(cv::Mat&, int, const int*, const size_t*, bool)':
G:\workspace\opencv-4.5.2\modules\core\src\matrix.cpp:259:126: warning: unknown conversion type character 'z' in format [-Wformat=]
                     CV_Error_(Error::BadStep, ("Step %zu for dimension %d must be a multiple of esz1 %zu", _steps[i], i, esz1));
                                                                                                                              ^
G:/workspace/opencv-4.5.2/modules/core/include/opencv2/core/base.hpp:334:61: note: in definition of macro 'CV_Error_'
 #define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )
                                                             ^
G:\workspace\opencv-4.5.2\modules\core\src\matrix.cpp:259:126: warning: unknown conversion type character 'z' in format [-Wformat=]
                     CV_Error_(Error::BadStep, ("Step %zu for dimension %d must be a multiple of esz1 %zu", _steps[i], i, esz1));
                                                                                                                              ^
G:/workspace/opencv-4.5.2/modules/core/include/opencv2/core/base.hpp:334:61: note: in definition of macro 'CV_Error_'
 #define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )
                                                             ^
G:\workspace\opencv-4.5.2\modules\core\src\matrix.cpp:259:126: warning: too many arguments for format [-Wformat-extra-args]
                     CV_Error_(Error::BadStep, ("Step %zu for dimension %d must be a multiple of esz1 %zu", _steps[i], i, esz1));
                                                                                                                              ^
G:/workspace/opencv-4.5.2/modules/core/include/opencv2/core/base.hpp:334:61: note: in definition of macro 'CV_Error_'
 #define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )

G:\workspace\opencv-4.5.2\modules\core\src\system.cpp:153:25: fatal error: fibersapi.h: No such file or directory
   #include <fibersapi.h>
                         ^
compilation terminated.
modules\world\CMakeFiles\opencv_world.dir\build.make:1388: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/__/core/src/system.cpp.obj' failed
mingw32-make[2]: *** [modules/world/CMakeFiles/opencv_world.dir/__/core/src/system.cpp.obj] Error 1
CMakeFiles\Makefile2:2361: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/all' failed
mingw32-make[1]: *** [modules/world/CMakeFiles/opencv_world.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

 在我的opencv-4.5.2下的cmakelist.txt中第153行即

#if ((_WIN32_WINNT >= 0x0600) && !defined(CV_DISABLE_FLS)) || defined(CV_FORCE_FLS)
  #include <fibersapi.h>
  #define CV_USE_FLS

在这三行的上面加上:

//add here
#define CV_DISABLE_FLS

即不让它进去,就不会报错了。然后重新打开cmake-gui进行configure和generate ,再关闭cmake-gui,接着继续mingw32-make

5,xphoto报错如下:

[ 32%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/xphoto/src/bm3d_image_denoising.cpp.obj
[ 32%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/xphoto/src/dct_image_denoising.cpp.obj
[ 32%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/xphoto/src/grayworld_white_balance.cpp.obj
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp: In function 'void cv::xphoto::calculateChannelSums(uint&, uint&, uint&, uchar*, int, float)':
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:133:58: error: 'v_sub' was not declared in this scope
         v_m1 = v_not(v_gt(v_mul_wrap(v_sub(v_max1, v_min1), v_255), v_mul_wrap(v_thresh, v_max1)));
                                                          ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:133:97: error: 'v_gt' was not declared in this scope
         v_m1 = v_not(v_gt(v_mul_wrap(v_sub(v_max1, v_min1), v_255), v_mul_wrap(v_thresh, v_max1)));
                                                                                                 ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:133:98: error: 'v_not' was not declared in this scope
         v_m1 = v_not(v_gt(v_mul_wrap(v_sub(v_max1, v_min1), v_255), v_mul_wrap(v_thresh, v_max1)));
                                                                                                  ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:137:40: error: 'v_and' was not declared in this scope
         v_iB1 = v_add(v_and(v_iB1, v_m1), v_and(v_iB2, v_m2));
                                        ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:137:61: error: 'v_add' was not declared in this scope
         v_iB1 = v_add(v_and(v_iB1, v_m1), v_and(v_iB2, v_m2));
                                                             ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp: In function 'void cv::xphoto::calculateChannelSums(uint64&, uint64&, uint64&, ushort*, int, float)':
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:200:53: error: 'v_sub' was not declared in this scope
         v_m1 = v_not(v_gt(v_mul(v_sub(v_max1, v_min1), v_65535), v_mul(v_thresh, v_max1)));
                                                     ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:200:63: error: 'v_mul' was not declared in this scope
         v_m1 = v_not(v_gt(v_mul(v_sub(v_max1, v_min1), v_65535), v_mul(v_thresh, v_max1)));
                                                               ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:200:89: error: 'v_gt' was not declared in this scope
         v_m1 = v_not(v_gt(v_mul(v_sub(v_max1, v_min1), v_65535), v_mul(v_thresh, v_max1)));
                                                                                         ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:200:90: error: 'v_not' was not declared in this scope
         v_m1 = v_not(v_gt(v_mul(v_sub(v_max1, v_min1), v_65535), v_mul(v_thresh, v_max1)));
                                                                                          ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:204:40: error: 'v_and' was not declared in this scope
         v_iB1 = v_add(v_and(v_iB1, v_m1), v_and(v_iB2, v_m2));
                                        ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:204:61: error: 'v_add' was not declared in this scope
         v_iB1 = v_add(v_and(v_iB1, v_m1), v_and(v_iB2, v_m2));
                                                             ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp: In function 'void cv::xphoto::applyChannelGains(cv::InputArray, cv::OutputArray, float, float, float)':
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp:285:56: error: no matching function for call to 'v_shr(cv::hal_baseline::v_uint16x8, int)'
             v_sB1 = v_shr(v_mul_wrap(v_sB1, v_gainB), 8);

取消BUILD_opencv_xphoto 然后重新打开cmake-gui进行configure和generate,接着依旧mingw32-make

6,rgbd报错

[ 65%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/rapid/src/histogram.cpp.obj
[ 65%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/rapid/src/rapid.cpp.obj
[ 65%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/rgbd/src/colored_kinfu.cpp.obj
In file included from G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\kinfu_frame.hpp:11:0,
                 from G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\fast_icp.hpp:11,
                 from G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\colored_kinfu.cpp:8:
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\utils.hpp: In function 'bool cv::kinfu::isNaN(const cv::hal_baseline::v_float32x4&)':
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\utils.hpp:71:37: error: 'v_ne' was not declared in this scope
     return cv::v_check_any(v_ne(p, p));
                                     ^
In file included from G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\hash_tsdf.hpp:12:0,
                 from G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\colored_kinfu.cpp:10:
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\tsdf_functions.hpp: In function 'cv::hal_baseline::v_float32x4 cv::kinfu::tsdfToFloat_INTR(const cv::hal_baseline::v_int32x4&)':
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\rgbd\src\tsdf_functions.hpp:23:40: error: 'v_mul' was not declared in this scope
     return v_mul(v_cvt_f32(num), num128);
                                        ^
modules\world\CMakeFiles\opencv_world.dir\build.make:7568: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/rgbd/src/colored_kinfu.cpp.obj' failed
mingw32-make[2]: *** [modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/rgbd/src/colored_kinfu.cpp.obj] Error 1
CMakeFiles\Makefile2:2361: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/all' failed
mingw32-make[1]: *** [modules/world/CMakeFiles/opencv_world.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

 取消BUILD_opencv_rgbd,然后执行那句不想赘述的话。

7,ximgproc报错

[ 78%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/xfeatures2d/src/vgg.cpp.obj
[ 78%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/xfeatures2d/src/xfeatures2d_init.cpp.obj
[ 78%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/opencl_kernels_xfeatures2d.cpp.obj
[ 78%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/ximgproc/src/adaptive_manifold_filter_n.cpp.obj
[ 78%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/ximgproc/src/anisodiff.cpp.obj
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp: In function 'cv::hal_baseline::v_uint8x16 cv::ximgproc::v_finalize_pix_ch(const cv::hal_baseline::v_int16x8&, const cv::hal_baseline::v_int16x8&, const cv::hal_baseline::v_float32x4&, const cv::hal_baseline::v_float32x4&, const cv::hal_baseline::v_float32x4&, const cv::hal_baseline::v_float32x4&, const cv::hal_baseline::v_float32x4&)':
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:77:56: error: 'v_mul' was not declared in this scope
     v_int16x8 d0 = v_pack(v_round(v_add(v_mul(s0, alpha), f0)), v_round(v_add(v_mul(s1, alpha), f1)));
                                                        ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:77:61: error: 'v_add' was not declared in this scope
     v_int16x8 d0 = v_pack(v_round(v_add(v_mul(s0, alpha), f0)), v_round(v_add(v_mul(s1, alpha), f1)));
                                                             ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp: In member function 'virtual void cv::ximgproc::ADBody::operator()(const cv::Range&) const':
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:138:51: error: 'v_sub' was not declared in this scope
                     v_int16x8 d00 = v_sub(p00, c00), d01 = v_sub(p01, c01);
                                                   ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:142:71: error: 'v_add' was not declared in this scope
                     v_uint16x8 n0 = v_add(v_add(v_abs(d00), v_abs(d10)), v_abs(d20));
                                                                       ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:142:84: error: 'v_add' was not declared in this scope
                     v_uint16x8 n0 = v_add(v_add(v_abs(d00), v_abs(d10)), v_abs(d20));
                                                                                    ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:142:84: error: redeclaration of '<typeprefixerror>v_add'
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:142:71: note: previous declaration '<typeprefixerror>v_add'
                     v_uint16x8 n0 = v_add(v_add(v_abs(d00), v_abs(d10)), v_abs(d20));
                                                                       ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:143:55: error: 'd01' was not declared in this scope
                     v_uint16x8 n1 = v_add(v_add(v_abs(d01), v_abs(d11)), v_abs(d21));
                                                       ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:143:67: error: 'd11' was not declared in this scope
                     v_uint16x8 n1 = v_add(v_add(v_abs(d01), v_abs(d11)), v_abs(d21));
                                                                   ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:143:80: error: 'd21' was not declared in this scope
                     v_uint16x8 n1 = v_add(v_add(v_abs(d01), v_abs(d11)), v_abs(d21));
                                                                                ^
G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\ximgproc\src\anisodiff.cpp:156:51: error: 'v_mul' was not declared in this scope
                     s00 = v_add(s00, v_mul(fd0, w0)); s01 = v_add(s01, v_mul(fd1, w1)); s02 = v_add(s02, v_mul(fd2, w2)); s03 = v_add(s03, v_mul(fd3, w3));
                                                   ^
modules\world\CMakeFiles\opencv_world.dir\build.make:9509: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/ximgproc/src/anisodiff.cpp.obj' failed
mingw32-make[2]: *** [modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/ximgproc/src/anisodiff.cpp.obj] Error 1
CMakeFiles\Makefile2:2361: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/all' failed
mingw32-make[1]: *** [modules/world/CMakeFiles/opencv_world.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

 取消BUILD_opencv_ximgproc,然后依旧执行那句不想赘述的话

8,aruco报错

[ 82%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/__/opencv_contrib-4.x/modules/aruco/src/aruco.cpp.obj
In file included from G:\workspace\opencv-4.5.2\opencv_contrib-4.x\modules\aruco\src\aruco.cpp:6:0:
G:/workspace/opencv-4.5.2/opencv_contrib-4.x/modules/aruco/include/opencv2/aruco.hpp:7:48: fatal error: opencv2/objdetect/aruco_detector.hpp: No such file or directory
 #include "opencv2/objdetect/aruco_detector.hpp"
                                                ^
compilation terminated.

取消BUILD_opencv_aruco ,执行那句话

9,python_bindings报错

[ 98%] Built target gen_opencv_python_source
[ 98%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj
In file included from G:\workspace\opencv-4.5.2\modules\python\src2\cv2.cpp:41:0:
G:/workspace/opencv-4.5.2/mingw4.9.2_32bit_build/modules/python_bindings_generator/pyopencv_generated_include.h:48:51: fatal error: opencv2/xphoto/bm3d_image_denoising.hpp: No such file or directory
 #include "opencv2/xphoto/bm3d_image_denoising.hpp"
                                                   ^
compilation terminated.
modules\python3\CMakeFiles\opencv_python3.dir\build.make:75: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj' failed
mingw32-make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj] Error 1
CMakeFiles\Makefile2:2572: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
mingw32-make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
Makefile:164: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

取消BUILD_python_bindings_generator,依旧执行那句话。

这次终于不再报错,顺利编译完毕,如下图所示:

然后mingw32-make install也很顺利:

 在G:\workspace\opencv-4.5.2\mingw4.9.2_32bit_build下生成了install文件夹,直接拷贝出去就可以使用这个第三方库了。

五、应用问题

我发现install下的库竟然是x64,不应该是x86吗?仪器32bit的库都是x86的命名,然后我抱着将信将疑的态度试了下这个新的库,发现无论我用ming32位或ming64位工程中都会报错!

我又试着用cmd重新mingw32-make以及mingw32-make install,依旧有问题。

然后我又试了windows powershell,还是一样有问题。

经过反思,发现问题出在我的编译器上,如下图我的git-bash打开默认是MING64,所以我cmake时是用的mingw32的gcc,但mingw32-make以及ming32-make install时实际使用的是mingw64!!!不伦不类,所以编译出来的库应用时会报错:

 所以我实际应该在MINGW32的这个命名行下进行编译。于是我重新卸载了我的git,重新Downloading Git for Windows 2.37.3 (32-bit) from FileHorse.com安装git-32bit,默认方式安装即可。然后重新mingw32-make以及mingw32-make install

 然后将新生成的install文件改名为opencv4.5.2_mingw32 将bin和lib添加到环境变量,然后就可以应用了。不再报错:

 

 六、编译完毕的包

至此,历经这些后,应该无论32位还是64位,无论哪个版本的都能自己编译了。遇到问题不可怕,分析问题原因,尝试解决办法。我觉得可怕的是报的错与解决方式完全没有关联,不方便寻根溯源去解决且无论怎么搜索,没有一个网友遇到过,才是最烦人的。

将编译完毕的opencv4.2.0_64bit_mingw4.9.2 、 opencv4.5.2_32bit_mingw4.9.2我也上传在了 https://download.csdn.net/download/wd1603926823/88651377

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1331086.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

R软件包ConsensusCluster进行共识聚类(Consensus Clustering)

从下面论文看到这个方法&#xff1a; Wang, Xin, et al. "Deep learning using bulk RNA-seq data expands cell landscape identification in tumor microenvironment." Oncoimmunology 11.1 (2022): 2043662. 这篇论文基于 AI 方法对 bulk RNA-seq 数据识别肿瘤微环…

qt项目-《图像标注软件》源码阅读笔记-Shape类绘图及其子类

目录 1. Shape 概览 2. Shape 基类 2.1 字段 2.2 方法 2.3 嵌套类型 3. Shape2D 2d形状纯虚基类 3.1 字段 3.2 方法 4. Shape3D 3d形状纯虚基类 5. Shape2D子类 5.1 Rectangle 矩形类 1. Shape 概览 功能&#xff1a;Shape类及其子类负责形状的绘制及形状的存储。…

【数据结构入门精讲 | 第十三篇】考研408、公司面试树专项练习(二)

在上一篇中我们进行了树的判断题、选择题、填空题专项练习&#xff0c;在这一篇中我们将进行编程题的相关练习。 目录 编程题R7-1 目录树R7-1 是否同一棵二叉搜索树R7-2 二叉搜索树的结构R7-3 平衡二叉树的根R7-1 完全二叉搜索树R7-1 修理牧场R7-2 嘴强王者R7-3 房屋分拆R7-4 动…

Qt/QML编程学习之心得:在QML中调用fileDialog(十六)

Qt中有一些内置的对话框dialog,比如 在QWidget工程中使用比较容易,比如 #include <QFileDialog>fileName = QFileDialog::getOpenFileName(this, tr("Open Image"), "/home/jana", tr("Image Files (*.png *.jpg *.bmp)")); 那么在QM…

【LearnOpenGL基础入门——5】着色器

目录 一.简介 二.GLSL 三.数据类型 四.输入与输出 五.Uniform 六.更多属性 一.简介 着色器(Shader)是运行在GPU上的小程序。这些小程序为图形渲染管线的某个特定部分而运行。从基本意义上来说&#xff0c;着色器只是一种把输入转化为输出的程序。着色器也是一种非常独立…

最新技术整理3款开源免费直播推流工具,实现实时视频推流、视频拉流,目标端可以是服务器、云平台、移动设备等(附源码)

最新技术整理3款开源免费直播推流工具&#xff0c;实现实时视频推流、视频拉流&#xff0c;目标端可以是服务器、云平台、移动设备等&#xff08;附源码&#xff09;。 什么是推流&#xff1f; 视频推流是指将实时的视频数据从一个源端发送到一个或多个目标端的过程。推流的源…

基于javaWeb的高校后勤报修系统的设计与实现论文

基于JavaWeb的高校后勤报修系统的设计与实现 摘 要 当下&#xff0c;正处于信息化的时代&#xff0c;许多行业顺应时代的变化&#xff0c;结合使用计算机技术向数字化、信息化建设迈进。以前学校对于后勤报修信息的管理和控制&#xff0c;采用人工登记的方式保存相关数据&…

python脚本 ssh工具 ssh上传文档 选择文档并上传到ssh服务器

此文分享一个python脚本,用于快速的定位、选择文档,并将其上传到指定的ssh服务器。 效果演示 🔥完整演示效果 👇第一步,显然,我们需要选择功能 👇第二步,我们需要定位并选择需要上传的文档 👇第三步,确认我们需要上传文档的ssh服务器 👇第四步,定位、选择…

mybatis的一级缓存使用以及禁用

目录 验证代码如下 mappper 代码 xml 中代码 实际执行代码 执行结果 DefaultSqlSession CachingExecutor BaseExecutor PerpetualCache 总结 禁用一级缓存 mapper 对应的 xml 的 select 查询设置 flushCache 属性为 true MappedStatement 的内部类 Builder 向外部变…

parseInt(0.0000005)大于等于5

文章目录 一、前言二、parseInt()的神秘行为三、解决parseInt()的奥秘四、结论五、最后 一、前言 parseInt() 是 JavaScript 的内置函数&#xff0c;用于解析数字字符串中的整数。例如&#xff0c;从数字字符串中解析整数100&#xff1a; const number parseInt(100); numbe…

Netty-3-封帧

实际上&#xff0c;数据的封帧与解帧本身虽然实现起来十分简单&#xff0c;但它们在本质上仍然是数据的一种编解码。 那么它们相比之前介绍的数据编解码有什么区别呢&#xff1f;单从编码目标看&#xff0c;之前介绍的数据编解码是为了对用户的数据对象进行传输。 封帧与解帧则…

【Linux】编辑、查看和搜索文件

大多数 Linux 发行版不包含真正的 vi;而是自带一款高级替代版本&#xff0c;叫做 vim(它是“vi improved”的简写)由 Bram Moolenaar 开发的&#xff0c;vim 相对于传统的 Unix vi 来说&#xff0c;取得了实质性进步。 启动和退出 vim 使用vim可以启动&#xff0c;如命令行输…

MyBatis 通过 SqlSession 实现动态Entity批量插入

需要几个关键点: 1、entity对应的service需要继承BaseService 2、entity对应的serviceImpl需要实现baseMapper方法&#xff0c;需要把当前的mapper返回去 3、entity对应的Mapper需要BaseMapper

快速安装方式安装开源OpenSIPS和CP控制界面

OpenSIPS是目前世界上主流的两个SIP软交换引擎(其中另外一个是kamailio)或者SIP信令服务器&#xff08;个人认为是比较正确的称谓&#xff09;。关于Opensips的基础和一些参数配置和安装方式笔者在很久以前的历史文档中有非常多的介绍。最近&#xff0c;很多用户使用OpenSIPS软…

PHP案例代码:PHP如何提供下载功能?

对Web开发人员来说,“下载”功能是一个非常常见的需求。在网站中提供文件下载,通常用于提供用户手册、软件升级、音乐、视频等各种资源文件。本教程将向您介绍如何实现一个PHP下载功能,同时告诉浏览器文件名称、文件大小、文件类型,并统计下载次数。 首先,我们需要了解一些…

蓝牙物联网在智能家居中的应用前景

物联网智能家居系统是应用物联网技术&#xff0c;在传统家居环境下将各种零散无序的电器整合成统一整体&#xff0c;实现家电的全程自动控制&#xff0c;满足用户高效管理需求的一种新型家居模式。 其主要的子系统有家居感知系统、家庭网络系统、智能家居控制管理系统等&#x…

Hadoop入门学习笔记——七、Hive语法

视频课程地址&#xff1a;https://www.bilibili.com/video/BV1WY4y197g7 课程资料链接&#xff1a;https://pan.baidu.com/s/15KpnWeKpvExpKmOC8xjmtQ?pwd5ay8 Hadoop入门学习笔记&#xff08;汇总&#xff09; 目录 七、Hive语法7.1. 数据库相关操作7.1.1. 创建数据库7.1.2…

Python之zip函数相关介绍

python3的zip函数 zip函数接受任意多个可迭代对象作为参数&#xff0c;将对象中对应的元素打包成一个tuple&#xff0c;然后返回一个可迭代的zip对象。 这个可迭代对象可以使用循环的方式列出其元素&#xff0c;若多个可迭代对象的长度不一致,则所返回的列表与长度最短的可迭…

WPF中使用DataGrid封装组合控件TreeView+DataGrid

&#xff08;关注博主后&#xff0c;在“粉丝专栏”&#xff0c;可免费阅读此文&#xff09; wpf的功能非常强大&#xff0c;很多控件都是原生的&#xff0c;但是要使用TreeViewDataGrid的组合&#xff0c;就需要我们自己去封装实现。 我们需要的效果如图所示&#x…

汽车品牌官网建设的效果如何

汽车、电动摩托车、自行车等是人们常用的出行工具&#xff0c;头部品牌不少&#xff0c;中小品牌也同样很多&#xff0c;在当今激烈竞争的市场&#xff0c;各商家都希望不断拓客寻求销量增长。由于市场产品同质化严重且无突出特色&#xff0c;加之选择性广&#xff0c;因此在实…