2014-05-23 32 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上工作...