C++ 在Visual Studio中使用Opencv_2.4.9时出现错误C1075?
在将OpenPC2.4.9中的库与VisualStudio2010链接之后,我构建并运行了一个程序,并收到了此错误消息C++ 在Visual Studio中使用Opencv_2.4.9时出现错误C1075?,c++,visual-studio-2010,opencv,C++,Visual Studio 2010,Opencv,在将OpenPC2.4.9中的库与VisualStudio2010链接之后,我构建并运行了一个程序,并收到了此错误消息 错误C1075:在左大括号“{”c:\users\iggy\documents\visual studio 2010\projects\open\u cv\u test\open\u cvtest\main.cpp(6)”之前找到的文件结尾匹配。 #包括 #包括 使用名称空间cv; int main(){ { IplImage*img=cvLoadImage(“C:\\Use
错误C1075:在左大括号“{”c:\users\iggy\documents\visual studio 2010\projects\open\u cv\u test\open\u cvtest\main.cpp(6)”之前找到的文件结尾匹配。
#包括
#包括
使用名称空间cv;
int main(){
{
IplImage*img=cvLoadImage(“C:\\Users\\9589693153\\Desktop\\Vids\\sqlite.png”);//根据图像文件名更改名称(image.jpg)。
cvNamedWindow(“示例1”,CV\u窗口\u正常);
cvShowImage(“示例1”,img);
cvWaitKey(0);
cvReleaseImage(&img);
CVD窗口(“示例1”);
返回0;
}
通常由不匹配的括号、大括号或其他成对字符引起
对于您的情况,请删除额外的}
:
int main(){
^
请停止使用不推荐使用的c-api,这是一条死胡同。
< >请用C++编写代码,
#包括
#包括
使用名称空间cv;
int main()//{
int main(){
^
#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;
}