The ability to compile 64-bit MEX-files that access functions in 32-bit DLL's is not available in MATLAB. 64-bit applications such as 64-bit MATLAB can only use 64-bit shared libraries. In general, you cannot mix 32-bit and 64-bit code in a single application. If you have a 64-bit application, everything related to that application, including the DLLs, must be compiled as 64-bit.
To work around this issue, any DLLs called by your code also need to be compiled in 64-bit (everything down to math libraries called, if any). Violating this restriction does not cause an error at the compilation or link stages, but the resulting MEX file cannot be loaded. If you recompile your various DLLs as 64-bit shared libraries, you can then build a pure 64-bit MEX file. This may involve modifying the source code for those DLLs to account for the change from 32-bit to 64-bit integers.
Best Answer