Closed xiongmingzhi closed 3 years ago
This should be a library link issue, you can read about https://stackoverflow.com/questions/34497099/opencv-undefined-reference-to-imread
这应该是一个库链接问题,您可以阅读有关https://stackoverflow.com/questions/34497099/opencv-undefined-reference-to-imread的信息
谢谢,确实是因为没有添加dnn的库,,,问题已经解决了。。。
CMakeFiles\cv.dir/objects.a(main.cpp.obj): In function
main': C:/Users/Administrator/Desktop/cv/main.cpp:8: undefined reference to
cv::imread(std::string const&, int)' C:/Users/Administrator/Desktop/cv/main.cpp:13: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)' collect2.exe: error: ld returned 1 exit status mingw32-make.exe[3]: [CMakeFiles\cv.dir\build.make:111: cv.exe] Error 1 mingw32-make.exe[2]: [CMakeFiles\Makefile2:95: CMakeFiles/cv.dir/all] Error 2 mingw32-make.exe[1]: [CMakeFiles\Makefile2:102: CMakeFiles/cv.dir/rule] Error 2 mingw32-make.exe: [Makefile:137: cv] Error 2