Redefinition Error during building s function in MATLAB 2018b.

3 visualizaciones (últimos 30 días)
Asang singh
Asang singh el 22 de Oct. de 2020
Editada: Asang singh el 22 de Oct. de 2020
I have one .h file lets call it sys_mem.h, this file is inluded in another internal.h file and this internal.h is inlcuded in s function created via legacy code in matlab.
Error observed:
Building with 'Microsoft Visual C++ 2017 (C)'.
Error using mex
misc.c
D:\common_gen\SYS\sys_mem.h(39): error C2371: 'size_t': redefinition; different
basic types
D:\algo\my_folder\misc.c: note: see declaration of 'size_t'
composition of external.h file:
line no 39 mentioned in the error from sys_mem.h is:
#ifndef size_t
typedef unsigned int size_t;
#else
Note: misc.c includes internal.h and internal.h includes sys_mem.h.
could anyone help me regarding this.
and one more thing is observed that the above mentioned error is not observed in MATLAB2010b.
Is it related with MSVS as it 2010b it was VS2010 and here it is 2017.
Thanks.

Respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by