c++ - "Can' t load OpenGL extension [glBindBuffer] in function IntGetProcAddress”Qt中OpenCV异常

标签 c++ qt exception opengl opencv

我从 opencv 网站下载了 OpenCV 2.4.6。为了避免问题我mentioned before ,我决定编译 OpenCV 库。经过CMake和Mingw32-make,编译成功。但是,当尝试显示 jpeg 图像时,一个简单的测试程序会崩溃。这是我的 .pro 和 main.cpp 文件:

.pro:

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += main.cpp

#INCLUDEPATH += D:/opencv2.4.6/build/include
INCLUDEPATH += D:/opencv2.4.6/release/install/include
LIBS += -LD:/opencv2.4.6/release/install/bin \
    -lopencv_core246 \
    -lopencv_highgui246 \
    -lopencv_imgproc246 \
    -lopencv_features2d246 \
    -lopencv_calib3d246

主要.cpp:

int main() {
    Mat input = imread("Z:/1.jpg");
    cv::imshow("1.jpg",input);
}

问题是:

OpenCV Error: OpenGL API call (Can't load OpenGL extension [glBindBuffer]) in In
tGetProcAddress, file ..\..\..\modules\core\src\gl_core_3_1.cpp, line 141
terminate called after throwing an instance of 'cv::Exception'
  what():  ..\..\..\modules\core\src\gl_core_3_1.cpp:141: error: (-219) Can't lo
ad OpenGL extension [glBindBuffer] in function IntGetProcAddress


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

我以前从来没有遇到过这样的问题。这有点奇怪。我应该怎么做才能摆脱这个问题?

最佳答案

尝试编译 OpenCV 后,似乎应该取消选中 WITH_OPENGL。现在程序运行正常。

关于c++ - "Can' t load OpenGL extension [glBindBuffer] in function IntGetProcAddress”Qt中OpenCV异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19272526/

相关文章:

c++ - 优化 boost::spirit::qi 解析器

c++ - 将 unsigned int 写入二进制文件

c++ - VC++,使按钮和文本框成为一个对象

java - Spring Boot 中是否有一个很好的 zalando-problem 实现示例?

javascript - Web Workers - 如何实现 importScripts() 的异常处理

java - 父子层次结构在重写时对抛出很重要吗?

c++ - 访问结构成员的模板函数

Qt布局 child 漂浮

qt - Qt 中的范围 slider (QSlider 中的两个 handle )

c++ - 如何返回 QList<specicObject*> 指针并且不会发生内存泄漏?