使用WSL和VS2022进行Opencv C++开发,应使用CMake项目,不应使用C++控制台项目。
否则会遇到无法链接的问题。
1>正在链接对象
1>/usr/bin/ld : error : /root/projects/***/obj/x64/Debug/main.o: in function `main':
1>E:\Learn\OnnxCpp\***\main.cpp(8): error : (.text+0xc4): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
1>/usr/bin/ld : error : /root/projects/***/main.cpp:11:(.text+0xf4): undefined reference to `cv::Mat::~Mat()'
1>collect2 : error : ld returned 1 exit status
浙公网安备 33010602011771号