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.
Okay for a starter, you are using the wrong headers for OpenCV3.0
#include <opencv2/core/core.hpp>
to#include <opencv2/core.hpp>
#include <opencv2/highgui/highgui.hpp>
to#include <opencv2/highgui.hpp>
And then report back!
Thank you, I changed it to what you said, but the error still exists
Are you linking the correct OpenCV libraries?