diff --git a/mex/sources/build.m b/mex/sources/build.m
index 6ae70bbec634312a1e6090b7b47c8b7af88943b4..7d4bd6aaa310c4a9ba9cbacaecc560ee2eee9f75 100644
--- a/mex/sources/build.m
+++ b/mex/sources/build.m
@@ -19,7 +19,7 @@ if strcmpi('GLNX86', computer) || strcmpi('GLNXA64', computer) ...
         || strcmpi('MACI', computer) || strcmpi('MAC', computer)
     % GNU/Linux (x86-32 or x86-64) or MacOS (Intel or PPC)
     if strcmpi('GLNXA64', computer) % 64 bits ?
-        COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -largeArrayDims' ];
+        COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -largeArrayDims -DMX_COMPAT_32' ];
     end
     LAPACK_PATH = '-lmwlapack';
     if VERSION <= 7.4