MEX compile error: unknown type name 'char16_t'

前端 未结 7 1272
南笙
南笙 2020-12-04 22:26

I cannot compile any MATLAB MEX code due to the following error:

In file included from /Applications/MATLAB_R2013a.app/extern/include/mex.h:58:
In file inclu         


        
相关标签:
7条回答
  • 2020-12-04 23:27

    I just add my own experiment (C++ only). The

    #define char16_t uint16_t 
    

    was causing some problem in the other parts of the mex file. In fact, subsequently to my mex file, char16_t was properly defined. By tracking the chain of includes, the proper type char16_t is set in a file named __config :

    typedef __char16_t char16_t;
    

    which is also the first file included from <algorithm>. So the hack consists in including algorithm before mex.h.

    #include <algorithm>
    #include "mex.h"
    

    and the proper settings are performed, still in a multiplatform manner and without changing anything in the build configuration.

    0 讨论(0)
提交回复
热议问题