我在windows 32bit下使用opencv工作了几个月,使用eclipse和mingw。几个小时后,我的程序通过构建,链接没有错误,但是当启动它时崩溃......我最喜欢的“不发送”窗口......
资源:
#include <opencv.hpp>
#include <windows.h>
#include <iostream>
using namespace std;
using namespace cv;
int main() {
Mat img(Mat::zeros(100, 100, CV_8U));
//imshow("window", img);
cout << "hello world!" << endl;
system("PAUSE");
return 0;
}
虽然 imshow 被评论,没有问题,但是当尝试使用 imshow 或 waitKey 时,它编译,但崩溃......
构建命令:
g++ "-IW:\\Software\\opencv\\build\\include" "-IW:\\Software\\opencv\\build\\include\\opencv" "-IW:\\Software\\opencv\\build\\include\\opencv2" -O3 -g3 -Wall -Wextra -c -fmessage-length=0 -o "src\\HelloWorld.o" "..\\src\\HelloWorld.cpp"
g++ "-LW:\\Software\\opencv\\build\\x64\\mingw\\lib" -o HelloWorld.exe "src\\HelloWorld.o" -lopencv_calib3d246 -lopencv_contrib246 -lopencv_core246 -lopencv_features2d246 -lopencv_flann246 -lopencv_gpu246 -lopencv_highgui246 -lopencv_imgproc246 -lopencv_legacy246 -lopencv_ml246 -lopencv_nonfree246 -lopencv_objdetect246 -lopencv_photo246 -lopencv_stitching246 -lopencv_superres246 -lopencv_video246 -lopencv_videostab246
系统为:Win7 64bit,Eclipse CDT Kepler,Mingw。在 trat 之前,我正在研究 XP 32bit。问题是否有可能来自操作系统?