MEX compile error: unknown type name 'char16_t'

前端 未结 7 1298
南笙
南笙 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:08

    Please see other answers if this method doesn't work.

    I upgraded my gcc/g++ compilers using homebrew to version 4.8 --> gcc-4.8 and g++-4.8.

    After that I changed the following lines in the mexopts.sh file:

    CXXFLAGS="-fno-common -fexceptions -arch $ARCHS -isysroot $MW_SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -std=c++11"
    

    In my mexopts.sh, this is line 150. I only added the -std=c++11 flag which is what I guess chappjc meant.

    EDIT: This is covered in the update by chappjc!

提交回复
热议问题