0

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?

1 Answer 1

2

I guess you mistyped. You wrote "cvNameWindow" instead of "cvNamedWindow".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.