2014-05-23 72 views
1

我读过这些问与答&作为:未知类型char16_t:MATLAB 2013a时,Xcode 5.1,OS X 10.9

但是当我尝试问题仍然存在编译一个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上运行。

回答

0

尝试这里的答案:MEX compile error: unknown type name 'char16_t'

这为我工作: “添加-std = C++ 11 CXXFLAGS在当前的mexopts.sh和编译的.cpp而不是.c文件(更新。 :这是行得通的),其他一些选项也随之而来。“

祝你好运...我试图让Matlab 2012a在我的Mac OS X 10.9上工作...