Error in simple OpenCv c++ program CodeBlock window 7
When I try running the below c++ program in codeBlock on windows 7 I am getting the following error.
"\test_opencv\main.cpp -o obj\Debug\main.o C:\Users\Root\Desktop\test_opencv\main.cpp: In function 'int main(int, char**)': C:\Users\Root\Desktop\test_opencv\main.cpp:13: error: 'cvNameWindow' was not declared in this scope Process terminated with status 1 (0 minutes, 1 seconds) 1 errors, 0 warnings"
=================================================开发者_运维技巧============== program
#include "cv.h"
#include "highgui.h"
#include "cvwimage.h"
#include <iostream>
using namespace std;
int main(int argc,char** argv)
{
IplImage *pImg;
cout << "Hello world!" << endl;
if(argc==2 && (pImg=cvLoadImage(argv[1],1))!=0)
{
cvNameWindow("Image",1);
cvShowImage("Image",pImg);
cvWaitKey(0);
cvDestroyWindow("Image");
cvReleaseImage(&pImg);
return 0;
}
return -1;
}
===================================== I have followed the steps given in this link to set up the opencv and codeBlock. http://opensourcecollection.blogspot.com/2011/04/how-to-setup-opencv-22-in-codeblocks.html.
What could be the problem?
I guess you mistyped. You wrote "cvNameWindow" instead of "cvNamedWindow".
精彩评论