Problem with #includes in mex file (seems to find the files, but creates a lot of errors - see below)

조회 수: 1 (최근 30일)
When I have a mex-file that works fine (with standard mex-includes) and then I simply put a new #include on top (without otherwise changing the code), I get 100s of error-messages like the ones below. It doesn't seem to matter, which includes. For example, I needed a better random number generator, so I tried "#include <random>". The error messages below are just the first few...
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\cmath(28): error: identifier "using" is undefined
using _CSTD acosf; using _CSTD asinf;
^
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\cmath(28): error: declaration is incompatible with "float __cdecl acosf(float)" (declared at line 185 of "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\math.h")
using _CSTD acosf; using _CSTD asinf;
^
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\cmath(28): error: identifier "using" is undefined
using _CSTD acosf; using _CSTD asinf;
^
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\cmath(28): error: declaration is incompatible with "float __cdecl asinf(float)" (declared at line 186 of "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\math.h")
using _CSTD acosf; using _CSTD asinf;
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\cmath(29): error: identifier "using" is undefined
using _CSTD atanf; using _CSTD atan2f; using _CSTD ceilf;
^
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\cmath(29): error: declaration is incompatible with "float __cdecl atanf(float)" (declared at line 187 of "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\\..\..\VC\INCLUDE\math.h")
using _CSTD atanf; using _CSTD atan2f; using _CSTD ceilf;

답변 (1개)

Yongjian Feng
Yongjian Feng 2021년 7월 28일
Seems like you need to play with the mex include path:

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by