OpenCV matlab bindings not working compiler issues

asked 2014-01-30 18:00:59 -0500

emmanuel gravatar image


I am trying to build opencv with matlab bindings. After running the cmake ( version, I am able to set the configuration somewhat correctly (it has trouble finding and its associated libraries and include for whatever reason) and I always get this message:

CMake Warning at modules/matlab/CMakeLists.txt:44 (message): Your compiler is 32-bit but your version of Matlab is 64-bit. To build Matlab bindings, please switch to a 64-bit compiler. Call Stack (most recent call first): modules/matlab/CMakeLists.txt:66 (warn_mixed_precision)

I have looked in the cmakelists.txt file in the .../modules/matlab directory to see what this issue is and it seems like my mex compiler is 32 bit. I am using Microsoft Visual Studio 10.0 and I looked into the mexopts.bat file and I see that the compiler has to be 64 bit. My gcc and g++ compilers are also 64 bit as well (I assuming mingwgcc and mingwg++). So I am not sure what the problem may be?

edit retag flag offensive close merge delete



In cmake, I changed my generator from MinGW ( which I am sure that I download the 64 bits compilers for C and C++) and changed to Visual Studio 12 64 bit and everything worked ( I did have to change from Python3.3 to Python 2.7 ). My problem now is that matlab doesn't seem to recognize opencv commands even when I do addpath('C:\opencvbuilds\modules\matlab\'); . Help please? :(

emmanuel gravatar imageemmanuel ( 2014-01-30 19:45:53 -0500 )edit

I have the same problem. The code compiles but is not recognized by matlab as a toolbox

masad801 gravatar imagemasad801 ( 2014-03-13 15:11:17 -0500 )edit