Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cannot create an OpenGL window

The following simple code fails with a

OpenCV Error: OpenGL API call (Can't load OpenGL extension [glGenerateMipmap]) i n IntGetProcAddress, file C:\opencv\2.4.7.2_prebuilt\opencv\sources\modules\core \src\gl_core_3_1.cpp, line 141

I built opencv with 2.4.7.2 with OpenGL enabled. The code below fails on Debug and Release mode, 64bit. I'm on Windows 7 - 64. I updated the graphics drivers (Intel GM45)... What is going wrong?

#include <string>

#include "opencv2/core/core.hpp"

#include "opencv2/highgui/highgui.hpp"

int main(int argc, char* argv[]) {

cv::Mat img = cv::Mat::zeros(640, 480, CV_8UC1);

cv::namedWindow("oglWin", cv::WINDOW_OPENGL);

cv::imshow("oglWin", img); // crash here

return 0;

}