I cannot compile any MATLAB MEX code due to the following error:
In file included from /Applications/MATLAB_R2013a.app/extern/include/mex.h:58:
In file included from /Applications/MATLAB_R2013a.app/extern/include/matrix.h:294:
/Applications/MATLAB_R2013a.app/extern/include/tmwtypes.h:819:9: error: unknown type name 'char16_t'
typedef char16_t CHAR16_T;
The only thing that has changed on my machine as far as I can remember is that Xcode was updated to version 5.1 (5B130a).
Any fix for the time being to compile MEX code in MATLAB?
[Running on OS 10.9.2 with Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)]
I just add my own experiment (C++ only). The
was causing some problem in the other parts of the mex file. In fact, subsequently to my mex file,
char16_t
was properly defined. By tracking the chain of includes, the proper typechar16_t
is set in a file named__config
:which is also the first file included from
<algorithm>
. So the hack consists in includingalgorithm
beforemex.h
.and the proper settings are performed, still in a multiplatform manner and without changing anything in the build configuration.