I am new in openCV. I have a c++ code like below.
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main(int argc, const char *argv[])
{
    Mat img(480,640,CV_8UC3,Scalar(255,0,0));
    if(img.empty())
    {
        cout<<"Picture can not load..."<<endl;
        return -1;
    }
    nameWindow("test",CV_WINDOW_AUTOSIZE);
    imshow("test",img);
    waitKey(0);
    destroyWindow("test");
    return 0;
} 
I try to compile this code in ubuntu 14.04. But when i do
g++ resimac.cpp  
it gives an error:
error: ‘nameWindow’ was not declared in this scope
  nameWindow("test",CV_WINDOW_AUTOSIZE);
                                      ^
What is the problem? How to solve it?
 
    