Ask Your Question

imshow reports runtime error after rebuilding opencv project with 'WITH_OPENGL' is on

asked 2013-08-10 01:55:13 -0500

CyberK gravatar image

updated 2013-08-10 01:57:31 -0500

I turned on WITH_OPENGL using CMake, and rebuild the project. imshow() reports runtime error. How can I fix this problem??

int main(int argc, const char * argv[]) { cv::Mat I = cv::imread("D:/PyramidPattern.jpg"); cv::imshow("test",I); return 0; }

runtime error: OpenCV Error: OpenGL API call (Can't load OpenGL extension [glGenerateMipmap]) i n unknown function, file C:\OpenCV\modules\core\src\gl_core_3_1.cpp, line 141

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-08-10 03:11:41 -0500

berak gravatar image

you need to call


before imshow()

edit flag offensive delete link more


Thank you! Problem solved!

CyberK gravatar imageCyberK ( 2013-08-10 11:57:20 -0500 )edit

Question Tools


Asked: 2013-08-10 01:55:13 -0500

Seen: 709 times

Last updated: Aug 10 '13