Ad

Invalid MEX-file '.mexw64': .mexw64 Is Not A Valid Win32 Application

- 1 answer

While trying to run opencv sample matlab call, I am getting an error

Invalid MEX-file 'mypath\displayImage.mexw64': mypath\displayImage.mexw64 is not a valid Win32 application.

There are no errors while compiling. Also there are no errors while compiling and running simple helloworld sample.

What can be a reason for this? Why it expects win32 when even filename says 64?

Matlab is 2013a, VS is 2012, both are 64bit.

UPDATE

I found this "solution" of year 2009 saying that any of called DLLs should be 64 bit.

Is this

(1) true nowadays, and

(2) possible in practice?

How to check if some called library is 32bit?

Ad

Answer

Ok my PATH was pointing to %OPENCV_DIR%\build\x86\vc11\bin and this was overriding any LIB settings.

This was at runtime.

I.e. when I fixed PATH value, program started to run even without recompiling.

Ad
source: stackoverflow.com
Ad