Error reporting details
Error reporting reason
In the opencv version you are currently using, the definition declaration related to legacy C API has been removed, and the content of legacy can still be from
legacy/constants_c.H
from the header file.
Therefore, the solution is also obvious. Open the error file directly, delete the original part of the error header file, and replace it with legacy/constants_c.H
.
Solution:
Open the cpp file with error
find the error header file location:
Delete the code of the header file containing the error and replace it with:
#include "opencv2/imgcodecs/legacy/constants_c.h"
Compiled successfully ~
if your problem is also solved, leave a praise~
Read More:
- [Solved] Cmake compile opencv open-source project Error: but it set OpenCV_FOUND to FALSE so package “OpenCV” is considered to be…
- [Solved] Opencv error: assertion__acrt_first_block == header
- [Solved] Opencv3. X fatal error: opencv2/nonfree/nonfree.hpp: there is no such file or directory
- Opencv Can not Find opencv2/gpu/gpu.hpp [How to Solve]
- [Solved] Opencv Calls PB Model Error: cv2.error: OpenCV(4.2.0)…
- [Solved] OpenCV Error: AttributeError: module ‘cv2‘ has no attribute ‘data‘
- Opencv c++ Read Video Error: capture.isOpened() Return false
- [Solved] VScode Run C++ File Error: fatal error:opencv2\core.hpp:No such file or diretory
- [Solved] ORB_SLAM3 Compile Error: opencv4.0 not found four
- OpenCV VideoWriter Failed to Start [How to Solve]
- OpenCV4 Error: imread(argv[1], CV_LOAD_IMAGE_COLOR);
- C++ Opencv+BaiDu OCR“error“: “unsupported_grant_type“, “error_description“: “The authorization grant
- [Solved] OpenCV VideoWriter Error: FFMPEG: tag ‘MP4V‘ is not supported with codec id 12 and format mp4
- CMake Error: The source directory “opencv Install Catalog“ does not appear to contain CMakeLists.txt.
- [Solved] Opencv Call yolov3 Error: IndexError: invalid index to scalar variable
- [Solved] OpenCv5 error: (-215:Assertion failed) !_descriptors.empty() in function ‘add‘
- [Solved] Opencv Compile Error: (CMake Error: The following variables are used in this project, but they are set to not)
- How to Solve OpenCV CVUI Error: LINK2019
- [Solved] OpenCV Train the class Error: Bad argument & Error: Insufficient memory
- Cmake Compile opencv error: The system is: Windows – 10.0.19042 – AMD64 (Log File)