I\'m working on a piece of software that consists of some core C++ code with python bindings. The C++ code uses a lot of OpenCV already but now I\'m trying to save an image some
I am not best on cmake, but you appear to have failed to link the imwrite()
function.
I'm on a Mac so this will be different if you are elsewhere, but if you look in the OpenCV libraries directory, specifically in libopencv_imgcodecs.dylib
like this:
nm -gUP libopencv_imgcodecs.dylib | grep -i write
You will see something like:
__ZN2cv7imwriteERKNS_6StringERKNS_11_InputArrayERKNSt3__16vector...
That means that imgcodecs
provides the function you need.
I am, I hope (thanks to @Ptaq666), reliably informed that the best way of adding this library will be to use:
find_package(OpenCV 3 REQUIRED)
followed by:
target_link_libraries(<as you already have> ${OpenCV_LIBRARIES})
Original suggestion
That means that imgcodecs
provides the function you need, so I think you need to add that into this line in your CMakeLists.txt
:
find_package(OpenCV 3 COMPONENTS core highgui imgproc REQUIRED)
I guess that will be something like:
find_package(OpenCV 3 COMPONENTS core highgui imgproc imgcodecs REQUIRED)