将openpc 2.4.9中的库与visual studio 2010链接后,我构建并运行了一个程序,并收到此错误消息。
error C1075: end of file found before the left brace '{'at ' c:\users\iggy\documents\visual studio 2010\projects\open_cv_test\open_cvtest\main.cpp(6)' was matched.
#include <opencv\cv.h>
#include <opencv\highgui.h>
using namespace cv;
int main(){
{
IplImage* img = cvLoadImage("C:\\Users\\9589693153\\Desktop\\Vids\\sqlite.png"); //change the name(image.jpg) according to your Image filename.
cvNamedWindow("Example1", CV_WINDOW_NORMAL);
cvShowImage("Example1", img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("Example1");
return 0;
}
答案 0 :(得分:2)
答案 1 :(得分:0)
而是用c ++编写代码,请。
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main() //{ <-- here's your excessive {, like herohuyongtao pointed out before
{
Mat img = imread("C:\\Users\\9589693153\\Desktop\\Vids\\sqlite.png"); //change the name(image.jpg) according to your Image filename.
namedWindow("Example1", CV_WINDOW_NORMAL);
imshow("Example1", img);
waitKey(0);
return 0;
}