我从 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/