c++ - Migrate from 32bi to 64bit - OpenCV/MinGW/Eclipse -
i'm working opencv couple of months under windows 32bit,with eclipse , mingw. after many hours, program go through build, link without errors, when start crashes... favorite "dont send" window.....
source:
#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; }
while imshow comented, there no problem, when try use imshow or waitkey, compiles, crashes ...
build commands:
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
the system is: win7 64bit, eclipse cdt kepler, mingw. before trat working on xp 32bit. there possibility problem comes operating system ?
try removing each or both -o3
, -g3
compile options. don't particularly play each other.
also check if you've installed , linking against 64-bit version of standard c++ library.
try remove system
command too. invokes external command, can problematic.
also replace cout
cerr
, unbuffered , better outputting debug messages.
if program still craches, comment each of lines single out line causes problem further tracking.
Comments
Post a Comment