问题描述
- 请问这段opencv代码为什么在debug下无法编译通过,但是release可以通过?
-
#include<opencv2corecore.hpp> #include<opencv2highguihighgui.hpp> using namespace cv; void main() { Mat image=imread("E:images7.jpg"); namedWindow("img"); imshow("img", image); waitKey(0); }
编译环境为opencv2.4.11+vs2013。这段最简单的测试程序无法在debug下编译通过。
附加依赖项为
opencv_calib3d2411.lib
opencv_contrib2411.lib
opencv_core2411.lib
opencv_features2d2411.lib
opencv_flann2411.lib
opencv_gpu2411.lib
opencv_highgui2411.lib
opencv_imgproc2411.lib
opencv_legacy2411.lib
opencv_ml2411d.lib
opencv_objdetect2411.lib
opencv_ts2411.lib
opencv_video2411.lib
opencv_nonfree2411.lib
opencv_ocl2411.lib
opencv_photo2411.lib
opencv_stitching2411.lib
opencv_superres2411.lib
opencv_videostab2411.lib
opencv_calib3d2411d.lib
opencv_contrib2411d.lib
opencv_core2411d.lib
opencv_features2d2411d.lib
opencv_flann2411d.lib
opencv_gpu2411d.lib
opencv_highgui2411d.lib
opencv_imgproc2411d.lib
opencv_legacy2411d.lib
opencv_objdetect2411d.lib
opencv_ts2411d.lib
opencv_video2411d.lib
opencv_nonfree2411d.lib
opencv_ocl2411d.lib
opencv_photo2411d.lib
opencv_stitching2411d.lib
opencv_superres2411d.lib
opencv_videostab2411d.lib
解决方案
你配置库有带d 和不带d的要分清楚
解决方案二:
OPENCV配置中的release与debug
解决方案三:
debug和release引用了不一样的lib或dll文件