I installed OpenCV 4.5.0 for a C++ project, and for some reason after running it gives me the following error: undefined symbol: _ZN2cv7imwriteERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERKSt6vectorIiSaIiEE
The demangled part is : cv::imwrite(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)
I tried several includes (opencv.hpp, core.hpp, imgcodecs.hpp, highgui.hpp), nothing helped.
I then tried to run the following command: nm -g /usr/lib/aarch64-linux-gnu/libopencv_imgcodecs.so | grep imwrite on a freshly flashed Nano, got the same error.
Okay I figured it out, it was not related to OpenCV or the Nano, but to the package cppyy I’m using to create a Python wrapper, I had to load the library opencv_imgcodecs there too. My mistake.