Reputation: 1407
Opencv cannot link cv::imwrite during linking. I am linking imgcodecs but still getting link error for imwrite. Interestingly no error for cv::imread only for cv::imwrite.
Opencv Version: 3.3.1
Compiler: gcc 4.4.7
Link line: -lopencv_imgcodecs -lopencv_imgproc -lopencv_core -llibjasper -lIlmImf -llibjpeg -llibpng -llibtiff -llibwebp -lzlib -la_baslt -lbsc -lbsi -lbigparmcm -lparmsdata -lses -lbregacclib -lbregdb -lbbcacheapi -lbregutil -lcomdb2api -ldbutil -lpeutil -lparmsbase -le_ipc -lbbmsgbufs -lbbipc -lsysutil -lunwind -lz
Upvotes: 2
Views: 1883
Reputation: 556
As far as I know imwrite is a part of highgui module (opencv 2.4) and imgcodecs for opencv 3.x.x. But its important what compiler and opencv version you are using. For example for mingw you need -lopencv_imgcodecs320 (for opencv 3.2.0)
Upvotes: 1