Ask Your Question

from 32bit to 64bit

asked 2013-08-26 05:10:40 -0500

I'm working with opencv for couple of months under windows 32bit,with eclipse and mingw. Now I tried to migrate to 64bit and encountered so many errors... is there tutorial for setting up opencv under 64bit OS ... ?

p.p. Now my program go through build, link without errors, but when start it crashes... my favorite "dont send" window.....

edit retag flag offensive close merge delete


Actually if your program crashes, then it reads 32bit libraries. Make sure that you have replaced x86 by x64 in your configurations and that you direct your path to the correct variables. You should also make sure that all 32 bit configurations are disabled, since the name of the actual dll's and lib's do not differ.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-26 06:05:23 -0500 )edit

With that compiles: g++ "-IW:\Software\opencv\build\include" -O0 -Wall -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_core246 -lopencv_highgui246

I checked everything 10 times, and reinstall but without any result...

when i compile only one cout runs, but when i try to run opencv crashes ...

Spas Hristov gravatar imageSpas Hristov ( 2013-08-26 06:25:01 -0500 )edit

In PATH I have: W:\Software\opencv\build\x64\mingw\bin

Spas Hristov gravatar imageSpas Hristov ( 2013-08-26 06:26:20 -0500 )edit

Yes but is the 32 bit path still in your path variable? IF so please remove it and try again.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-26 06:36:30 -0500 )edit

I'm installing on other mashine. I deleted the path in PATH and then get error for missing DLL - OK, then copy the DLLs directly to the release folder, same crash...

Spas Hristov gravatar imageSpas Hristov ( 2013-08-26 06:45:03 -0500 )edit

But are you including the correct includes for the cout functionality? Since it crashes on cout like you said?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-26 06:49:30 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-08-26 07:15:39 -0500

That is working, no crashes:

#include <opencv2/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;
    return 0;

but when uncoment imshow crashes .. ?!? or add waitKey(0);

edit flag offensive delete link more


This is normal, since you did not include the highgui interface. Add #include <opencv2/highgui/highgui.cpp> and it should work.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-26 07:20:38 -0500 )edit

highgui.hpp is includet in opencv.hpp, after all I tried and that - same result

Spas Hristov gravatar imageSpas Hristov ( 2013-08-26 07:26:07 -0500 )edit

Oh excuse me, didn't looked into the opencv.hpp header :) My apologies :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-26 08:06:12 -0500 )edit

Question Tools


Asked: 2013-08-26 05:10:40 -0500

Seen: 478 times

Last updated: Aug 26 '13