Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mac 10.10.4, opencv3.0 in qt creator can't use imwrite

In my program, I want to use imwrite to save a picture, but I got two compile error, which says: error: symbol(s) not found for architecture x86_64 error: linker command failed with exit code 1 (use -v to see invocation) this is my program:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
int main()
{
cv::Mat image=cv::imread("/Users/yinxiangnan/Desktop/lena.jpg");
cv::namedWindow("My Image");
cv::Mat image1;
cv::flip(image,image1,1);
cv::imshow("My Image",image1);
cv::imwrite("/Users/yinxiangnan/Desktop/test.bmp",image1);
cv::waitKey(0);
return 0;
}

I can run the program in Xcode, and I can also run it after comment the imwrite line.