Borrar filtros
Borrar filtros

Wired MEX compiler error

2 visualizaciones (últimos 30 días)
Denis Bethäuser
Denis Bethäuser el 11 de En. de 2017
Comentada: James Tursa el 2 de Dic. de 2019
Hey there, I tried to compile the example program for the HCRF library of Yale Song. The source can be found here: HCRFlight. I use Ubuntu 16.04, Matlab R2016b and the g++ 4.7 as commented by Mathworks. During the compilation of the library I get this strange compiler error:
Error using mex /usr/share/MATLAB/R2016b/extern/version/cpp_mexapi_version.cpp: In Funktion »void mexfilerequiredapiversion(unsigned int*, unsigned int*)«: /usr/share/MATLAB/R2016b/extern/version/cpp_mexapi_version.cpp:6:21: Fehler: »MX_TARGET_API_VER« wurde in diesem Gültigkeitsbereich nicht definiert
Which basically means that "MX_TARGET_API_VER" is not defined in this scope. As you can see from the path, the error occurs in a file from Mathworks. How may I solve this error? I’m kinda confused by the error message and I haven’t found anything on google.
  1 comentario
Vandana Ravichandran
Vandana Ravichandran el 19 de En. de 2017
I am receiving the same error in MATLAB R2016b. However, the code compiled successfully in MATLAB R2016a. Can you try this in R2016a?

Iniciar sesión para comentar.

Respuestas (1)

Vandana Ravichandran
Vandana Ravichandran el 19 de En. de 2017
The mex compilation is successful in MATLAB R2016a. However, in MATLAB R2016b we receive an error - "MX_TARGET_API_VER was not declared in this scope"
The problem is because of the "matrix.h" file present in the library in the folder hCRFlight/lib/matlab/include/
This is a custom version of "matrix.h" which looks like a revision of "matrix.h" shipped with MATLAB R2016a.
In MATLAB R2016b, some MEX related changes were made to "matrix.h". The MEX command fails in R2016b because the revised R2016a version of "matrix.h" is not compatible with the official R2016b version of "matrix.h".
In order to make the package work with MATLAB R2016b:
a. You may revise the custom "matrix.h" to include all the contents from the R2016b version of "matrix.h".
b. Refactor the code to always include the default "matrix.h" shipped with MATLAB R2016b and use a different header file to contain other definitions from the custom "matrix.h".
  3 comentarios
Ashley Ware
Ashley Ware el 1 de Dic. de 2019
I am also having this issue. Were you able to find a solution?
James Tursa
James Tursa el 2 de Dic. de 2019

Iniciar sesión para comentar.

Categorías

Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by