Redefinition Error during building s function in MATLAB 2018b.

2 views (last 30 days)
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.

Answers (0)

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!