【问题标题】:Unknown type char16_t: MATLAB 2013a, Xcode 5.1, OS X 10.9未知类型 char16_t:MATLAB 2013a、Xcode 5.1、OS X 10.9
【发布时间】:2014-07-12 20:29:04
【问题描述】:

我已经阅读了这些问答:

但是当我尝试编译 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


    【解决方案1】:

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

    这对我有用: “在您当前的 mexopts.sh 中将 -std=c++11 添加到 CXXFLAGS。并编译 .cpp 文件而不是 .c。(更新:这是有效的)。还有一些其他选项。”

    祝你好运...我正在尝试让 Matlab 2012a 在我的 Mac OS X 10.9 上运行...

    【讨论】:

      猜你喜欢
      • 2014-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-12
      • 2014-10-10
      • 1970-01-01
      • 2014-05-03
      相关资源
      最近更新 更多