【发布时间】:2014-07-12 20:29:04
【问题描述】:
我已经阅读了这些问答:
- 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; 我还尝试添加-Dchar16_t=uint16_t 在 CXXFLAGS 中,但问题仍然存在......
我在 Mac OS X 10.9、Xcode 5.1.1 和 MATLAB 2013a 上运行。
【问题讨论】:
标签: c macos matlab compiler-errors xcode5