using highgui - difficulties with namedWindow [closed]
Dear all,
I am new with openCV, I am trying to use the graphical interface highgui.
I have tried the following very simple piece of code, which is compiled properly, but when I run it I get an error message like
"Unhandled exception at 0x774f15de in try1.exe: 0xC0000005: Access violation reading location 0xcccc006f."
What am I doing wrong?
Here is the code:
// try1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
//#include "myfunc.h"
using namespace std;
using namespace cv;
int _tmain(int argc, _TCHAR* argv[])
{
namedWindow("Hello");
return 0;
}
I don't know if it matters, I have created a C++ console application with Visual Studio 10.
I thank you for your very kind help.
just out of curiosity... is there any special reason why you are using _tmain??
I would recommend creating a project (console base) and specifying that there is NO code added when created. Later you will add an empty cpp file in which you will write the normal int main().
I am doing that and have no problem whatsoever. (also using VS 10 express)