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

1 vue (au cours des 30 derniers jours)
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;

Réponses (1)

Yongjian Feng
Yongjian Feng le 28 Juil 2021
Seems like you need to play with the mex include path:

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by