这个错误定位了半小时,还网上各种搜索,要怪只能怪学校没让我学C,直接学C++,连printf都不会写(为自己的蠢找借口,蒙脸不愿见人)
1、代码
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include<iostream> #include<math.h> using namespace cv; using namespace std; Mat src; int main(int argc,char** argv) { src = imread("F:/yourtask/OpenCV/picturelibrary/caseone/a.jpg"); if (src.empty()) { print("could not load image\n"); return -1; } namedWindow("input image",WINDOW_AUTOSIZE); imshow("input image", src); waitKey(0); return 0; }
2、错误现象:
严重性 代码 说明 项目 文件 行 禁止显示状态
错误 C2664 “std::shared_ptr<T>::shared_ptr(std::shared_ptr<T> &&) noexcept”: 无法将参数 1 从“Y *”转换为“std::nullptr_t” qiebiana d:\program files (x86)\opencv-4.0.0-alpha-vc14_vc15\opencv\build\include\opencv2\core\cvstd_wrapper.hpp 93
2、错误原因
printf写成了print。