我读过这些问与答&作为:未知类型char16_t:MATLAB 2013a时,Xcode 5.1,OS X 10.9
- MEX compile error: unknown type name 'char16_t'
- Mex files using Xcode 5.1 under OS X 10.9 with MATLAB 2012a
但是当我尝试问题仍然存在编译一个Simulink文件。我的mexopts.sh
文件可以找到here。我修改了mexopts.sh
,我保存了该文件并运行了mex -setup
。我从Simulink中出现以下错误:
Making simulation target "MySimulator_sfun", ...
/Applications/MATLAB_R2013a.app/bin/mex -c -O -DMATLAB_MEX_FILE -I/Applications/MATLAB_R2013a.app/stateflow/c/mex/include -I/Applications/MATLAB_R2013a.app/stateflow/c/debugger/include MySimulator_sfun.c
In file included from MySimulator_sfun.c:3:
In file included from ./MySimulator_sfun.h:6:
In file included from /Applications/MATLAB_R2013a.app/stateflow/c/mex/include/sfc_sf.h:33:
In file included from /Applications/MATLAB_R2013a.app/simulink/include/mwmathutil.h:23:
/Applications/MATLAB_R2013a.app/extern/include/tmwtypes.h:819:9: error: unknown
type name 'char16_t'
typedef char16_t CHAR16_T;
^
1 error generated.
mex: compile of ' "MySimulator_sfun.c"' failed.
gmake: *** [MySimulator_sfun.o] Error 1
此外,我试图设置“语言”在我的“代码生成选项”到C++而不是C.我也试图在Code Generation > Custom Code > Header File
添加类型定义,是typedef uint16_t char16_t;
我也试图在CXXFLAGS中添加一个-Dchar16_t=uint16_t
,但问题依然存在......
我在Mac OS X 10.9,Xcode 5.1.1和MATLAB 2013a上运行。