MATLAB Coder: gmake: *** [Bayer_2Step_data.o] Error 1

7 views (last 30 days)
When I use the MATLAB Coder in MATLAB 2018a I meet some trouble. Please notice that there are some '/' which should be '\' in those paths. How to correct those '/'? For example: C:\MinGW\include/stdio.h
C:\TDM-GCC-64\bin\gcc -c -fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE -DMATLAB_MEX_FILE -O2 -fwrapv -DNDEBUG -I "D:\MATLAB\R2018a/simulink/include" -I "D:\MATLAB\R2018a/toolbox/shared/simtargets" -I "C:\Users\ASUSFX~1\Desktop\sketch\HARDCO~1\trans\codegen\mex\Bayer_2Step" -I "C:\Users\ASUSFX~1\Desktop\sketch\HARDCO~1\trans" -I ".\interface" -I "D:\MATLAB\R2018a\extern\include" -I "." "Bayer_2Step_data.c"
In file included from C:/TDM-GCC-64/x86_64-w64-mingw32/include/stddef.h:7:0,
from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/stddef.h:1,
from C:\MinGW\include/stdio.h:69,
from Bayer_2Step.h:13,
from Bayer_2Step_data.c:10:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:35:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
__MINGW_EXTENSION typedef unsigned __int64 size_t;
^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:45:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
__MINGW_EXTENSION typedef __int64 ssize_t;
^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:52:9: error: unknown type name 'size_t'
typedef size_t rsize_t;
^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:62:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
__MINGW_EXTENSION typedef __int64 intptr_t;
^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:75:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
__MINGW_EXTENSION typedef unsigned __int64 uintptr_t;
^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:88:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
__MINGW_EXTENSION typedef __int64 ptrdiff_t;
^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:123:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
__MINGW_EXTENSION typedef __int64 __time64_t;
^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:138:9: error: unknown type name '__time64_t'
typedef __time64_t time_t;
^
In file included from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/stddef.h:1:0,
from C:\MinGW\include/stdio.h:69,
from Bayer_2Step.h:13,
from Bayer_2Step_data.c:10:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/stddef.h:26:36: error: expected ',' or ';' before '__threadhandle'
_CRTIMP extern uintptr_t __cdecl __threadhandle(void);
^
In file included from Bayer_2Step.h:13:0,
from Bayer_2Step_data.c:10:
C:\MinGW\include/stdio.h:295:71: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int setvbuf (FILE *, char *, int, size_t);
^
C:\MinGW\include/stdi *bold* o.h:309:54: error: unknown type name 'size_t'
extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...);
^
C:\MinGW\include/stdio.h:313:55: error: unknown type name 'size_t'
extern int __mingw_stdio_redirect__(vsnprintf)(char*, size_t, const char*, __VALIST);
^
C:\MinGW\include/stdio.h:442:57: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _snprintf (char *, size_t, const char *, ...);
^
C:\MinGW\include/stdio.h:443:58: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _vsnprintf (char *, size_t, const char *, __VALIST);
^
C:\MinGW\include/stdio.h:453:48: error: unknown type name 'size_t'
__cdecl __MINGW_NOTHROW int snprintf (char *, size_t, const char *, ...);
^
C:\MinGW\include/stdio.h:454:49: error: unknown type name 'size_t'
__cdecl __MINGW_NOTHROW int vsnprintf (char *, size_t, const char *, __VALIST);
^
C:\MinGW\include/stdio.h:662:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t fread (void *, size_t, size_t, FILE *);
^
C:\MinGW\include/stdio.h:662:56: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t fread (void *, size_t, size_t, FILE *);
^
C:\MinGW\include/stdio.h:662:64: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t fread (void *, size_t, size_t, FILE *);
^
C:\MinGW\include/stdio.h:663:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t fwrite (const void *, size_t, size_t, FILE *);
^
C:\MinGW\include/stdio.h:663:63: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t fwrite (const void *, size_t, size_t, FILE *);
^
C:\MinGW\include/stdio.h:663:71: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t fwrite (const void *, size_t, size_t, FILE *);
^
C:\MinGW\include/stdio.h:890:64: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _snwprintf (wchar_t *, size_t, const wchar_t *, ...);
^
C:\MinGW\include/stdio.h:892:65: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST);
^
C:\MinGW\include/stdio.h:933:52: error: unknown type name 'size_t'
__cdecl __MINGW_NOTHROW int snwprintf (wchar_t *, size_t, const wchar_t *, ...);
^
C:\MinGW\include/stdio.h:934:53: error: unknown type name 'size_t'
__cdecl __MINGW_NOTHROW int vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST);
^
C:\MinGW\include/stdio.h:939:31: error: unknown type name 'size_t'
int vsnwprintf (wchar_t *__s, size_t __n, const wchar_t *__fmt, __VALIST __arg)
^
In file included from Bayer_2Step.h:14:0,
from Bayer_2Step_data.c:10:
C:\MinGW\include/stdlib.h:468:50: error: unknown type name 'size_t'
wchar_t *_wfullpath (wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/stdlib.h:474:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t wcstombs (char *, const wchar_t *, size_t);
^
C:\MinGW\include/stdlib.h:474:76: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t wcstombs (char *, const wchar_t *, size_t);
^
C:\MinGW\include/stdlib.h:477:59: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int mblen (const char *, size_t);
^
C:\MinGW\include/stdlib.h:478:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t mbstowcs (wchar_t *, const char *, size_t);
^
C:\MinGW\include/stdlib.h:478:76: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t mbstowcs (wchar_t *, const char *, size_t);
^
C:\MinGW\include/stdlib.h:479:71: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int mbtowc (wchar_t *, const char *, size_t);
^
C:\MinGW\include/stdlib.h:486:57: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void *realloc (void *, size_t);
^
C:\MinGW\include/stdlib.h:504:30: error: unknown type name 'size_t'
(const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
^
C:\MinGW\include/stdlib.h:504:38: error: unknown type name 'size_t'
(const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
^
C:\MinGW\include/stdlib.h:507:10: error: unknown type name 'size_t'
(void *, size_t, size_t, int (*)(const void *, const void *));
^
C:\MinGW\include/stdlib.h:507:18: error: unknown type name 'size_t'
(void *, size_t, size_t, int (*)(const void *, const void *));
^
C:\MinGW\include/stdlib.h:569:71: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW char *_fullpath (char*, const char*, size_t);
^
In file included from C:\MinGW\include/string.h:62:0,
from Bayer_2Step.h:15,
from Bayer_2Step_data.c:10:
C:\MinGW\include/strings.h:64:70: error: unknown type name 'size_t'
int __cdecl __MINGW_NOTHROW strncasecmp( const char *, const char *, size_t );
^
C:\MinGW\include/strings.h:78:77: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _strnicmp( const char *, const char *, size_t );
^
C:\MinGW\include/strings.h:92:56: error: unknown type name 'size_t'
int strncasecmp( const char *__s1, const char *__s2, size_t __n )
^
In file included from Bayer_2Step.h:15:0,
from Bayer_2Step_data.c:10:
C:\MinGW\include/string.h:70:67: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void *memchr (const void *, int, size_t) __MINGW_ATTRIB_PURE;
^
C:\MinGW\include/string.h:71:74: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int memcmp (const void *, const void *, size_t) __MINGW_ATTRIB_PURE;
^
C:\MinGW\include/string.h:72:70: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void *memcpy (void *, const void *, size_t);
^
C:\MinGW\include/string.h:73:71: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void *memmove (void *, const void *, size_t);
^
C:\MinGW\include/string.h:74:61: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void *memset (void *, int, size_t);
^
C:\MinGW\include/string.h:80:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t strcspn (const char *, const char *) __MINGW_ATTRIB_PURE;
^
C:\MinGW\include/string.h:83:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t strlen (const char *) __MINGW_ATTRIB_PURE;
^
C:\MinGW\include/string.h:84:71: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW char *strncat (char *, const char *, size_t);
^
C:\MinGW\include/string.h:85:75: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int strncmp (const char *, const char *, size_t) __MINGW_ATTRIB_PURE;
^
C:\MinGW\include/string.h:86:71: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW char *strncpy (char *, const char *, size_t);
^
C:\MinGW\include/string.h:89:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t strspn (const char *, const char *) __MINGW_ATTRIB_PURE;
^
C:\MinGW\include/string.h:92:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t strxfrm (char *, const char *, size_t);
^
C:\MinGW\include/string.h:92:72: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t strxfrm (char *, const char *, size_t);
^
C:\MinGW\include/string.h:99:77: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void *_memccpy (void *, const void *, int, size_t);
^
C:\MinGW\include/string.h:100:76: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _memicmp (const void *, const void *, size_t);
^
C:\MinGW\include/string.h:105:63: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW char *_strnset (char *, int, size_t);
^
C:\MinGW\include/string.h:109:68: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void _swab (const char *, char *, size_t);
^
C:\MinGW\include/string.h:125:76: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _strncoll(const char *, const char *, size_t);
^
C:\MinGW\include/string.h:126:77: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _strnicoll(const char *, const char *, size_t);
^
C:\MinGW\include/string.h:133:76: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void *memccpy (void *, const void *, int, size_t);
^
C:\MinGW\include/string.h:134:75: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int memicmp (const void *, const void *, size_t);
^
C:\MinGW\include/string.h:140:76: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int strnicmp (const char *, const char *, size_t);
^
C:\MinGW\include/string.h:141:62: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW char *strnset (char *, int, size_t);
^
C:\MinGW\include/string.h:150:67: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW void swab (const char *, char *, size_t);
^
In file included from C:\MinGW\include/string.h:165:0,
from Bayer_2Step.h:15,
from Bayer_2Step_data.c:10:
C:\MinGW\include/wchar.h:397:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t wcscspn (const wchar_t *, const wchar_t *);
^
C:\MinGW\include/wchar.h:398:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t wcslen (const wchar_t *);
^
C:\MinGW\include/wchar.h:399:80: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsncat (wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:400:81: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int wcsncmp (const wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:401:80: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsncpy (wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:404:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t wcsspn (const wchar_t *, const wchar_t *);
^
C:\MinGW\include/wchar.h:407:34: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t wcsxfrm (wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:407:78: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW size_t wcsxfrm (wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:416:83: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _wcsnicmp (const wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:417:73: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wcsnset (wchar_t *, wchar_t, size_t);
^
C:\MinGW\include/wchar.h:423:83: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _wcsncoll (const wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:424:84: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int _wcsnicoll (const wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:461:82: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW int wcsnicmp (const wchar_t *, const wchar_t *, size_t);
^
C:\MinGW\include/wchar.h:462:72: error: unknown type name 'size_t'
_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsnset (wchar_t *, wchar_t, size_t);
^
In file included from Bayer_2Step.h:15:0,
from Bayer_2Step_data.c:10:
C:\MinGW\include/string.h:187:8: error: unknown type name 'size_t'
extern size_t __mingw_strnlen (const char *, size_t);
^
C:\MinGW\include/string.h:187:46: error: unknown type name 'size_t'
extern size_t __mingw_strnlen (const char *, size_t);
^
C:\MinGW\include/string.h:190:13: error: unknown type name 'size_t'
__CRT_ALIAS size_t strnlen (const char *__text, size_t __maxlen)
^
C:\MinGW\include/string.h:190:49: error: unknown type name 'size_t'
__CRT_ALIAS size_t strnlen (const char *__text, size_t __maxlen)
^
In file included from Bayer_2Step.h:16:0,
from Bayer_2Step_data.c:10:
D:\MATLAB\R2018a\extern\include/tmwtypes.h:795:9: error: unknown type name 'size_t'
typedef size_t mwSize; /* unsigned pointer-width integer */
^
D:\MATLAB\R2018a\extern\include/tmwtypes.h:796:9: error: unknown type name 'size_t'
typedef size_t mwIndex; /* unsigned pointer-width integer */
^
D:\MATLAB\R2018a\extern\include/tmwtypes.h:797:9: error: unknown type name 'ptrdiff_t'
typedef ptrdiff_t mwSignedIndex; /* a signed pointer-width integer */
^
In file included from D:\MATLAB\R2018a\extern\include/mex.h:8:0,
from Bayer_2Step.h:17,
from Bayer_2Step_data.c:10:
D:\MATLAB\R2018a\extern\include/matrix.h:814:52: error: unknown type name 'size_t'
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void *mxMalloc(size_t n /* number of bytes */
^
D:\MATLAB\R2018a\extern\include/matrix.h:820:52: error: unknown type name 'size_t'
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void *mxCalloc(size_t n, /* number of objects */
^
D:\MATLAB\R2018a\extern\include/matrix.h:821:52: error: unknown type name 'size_t'
size_t size /* size of objects */
^
D:\MATLAB\R2018a\extern\include/matrix.h:832:64: error: unknown type name 'size_t'
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void *mxRealloc(void *ptr, size_t size);
^
D:\MATLAB\R2018a\extern\include/matrix.h:847:37: error: unknown type name 'size_t'
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C size_t mxGetM(const mxArray *pa);
^
D:\MATLAB\R2018a\extern\include/matrix.h:1042:37: error: unknown type name 'size_t'
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C size_t mxGetNumberOfElements(
^
D:\MATLAB\R2018a\extern\include/matrix.h:1114:37: error: unknown type name 'size_t'
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C size_t mxGetN(const mxArray *pa);
^
D:\MATLAB\R2018a\extern\include/matrix.h:1140:37: error: unknown type name 'size_t'
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C size_t mxGetElementSize(const mxArray *pa);
^
D:\MATLAB\R2018a\extern\include/matrix.h:1223:29: error: unknown type name 'size_t'
mxCreateUninitNumericMatrix(size_t m, size_t n, mxClassID classid, mxComplexity flag);
^
D:\MATLAB\R2018a\extern\include/matrix.h:1223:39: error: unknown type name 'size_t'
mxCreateUninitNumericMatrix(size_t m, size_t n, mxClassID classid, mxComplexity flag);
^
D:\MATLAB\R2018a\extern\include/matrix.h:1230:28: error: unknown type name 'size_t'
mxCreateUninitNumericArray(size_t ndim, size_t *dims, mxClassID classid, mxComplexity flag);
^
D:\MATLAB\R2018a\extern\include/matrix.h:1230:41: error: unknown type name 'size_t'
mxCreateUninitNumericArray(size_t ndim, size_t *dims, mxClassID classid, mxComplexity flag);
^
In file included from Bayer_2Step.h:17:0,
from Bayer_2Step_data.c:10:
D:\MATLAB\R2018a\extern\include/mex.h:41:3: error: unknown type name 'size_t'
size_t length;
^
In file included from Bayer_2Step.h:18:0,
from Bayer_2Step_data.c:10:
D:\MATLAB\R2018a\extern\include/emlrt.h:153:5: error: unknown type name 'size_t'
size_t fIOBufSize;
^
D:\MATLAB\R2018a\extern\include/emlrt.h:220:66: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API int32_T emlrtMexSnprintf(char * retString, size_t n, const char *aFmt, ...);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:336:23: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API size_t emlrtSizeMulR2012b(size_t s1,
^
D:\MATLAB\R2018a\extern\include/emlrt.h:336:49: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API size_t emlrtSizeMulR2012b(size_t s1,
^
D:\MATLAB\R2018a\extern\include/emlrt.h:337:49: error: unknown type name 'size_t'
size_t s2,
^
D:\MATLAB\R2018a\extern\include/emlrt.h:738:61: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void* emlrtMalloc(emlrtConstCTX aTLS, size_t aSize);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:743:61: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void* emlrtCalloc(emlrtConstCTX aTLS, size_t aNum, size_t aSize);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:743:74: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void* emlrtCalloc(emlrtConstCTX aTLS, size_t aNum, size_t aSize);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:758:44: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void* emlrtMallocMex(size_t aSize);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:763:44: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void* emlrtCallocMex(size_t aNum, size_t aSize);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:763:57: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void* emlrtCallocMex(size_t aNum, size_t aSize);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:1105:56: error: unknown type name 'size_t'
size_t sizeofSerializedReport,
^
In file included from Bayer_2Step.h:18:0,
from Bayer_2Step_data.c:10:
D:\MATLAB\R2018a\extern\include/emlrt.h:1120:62: error: unknown type name 'size_t'
size_t sizeofSerializedReport);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:1540:45: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void* emlrtFFTWMalloc(size_t aSize);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:1677:44: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void * emlrtMxCalloc(size_t numEl, size_t elSize);
^
D:\MATLAB\R2018a\extern\include/emlrt.h:1677:58: error: unknown type name 'size_t'
EXTERN_C LIBEMLRT_API void * emlrtMxCalloc(size_t numEl, size_t elSize);
^
In file included from Bayer_2Step.h:19:0,
from Bayer_2Step_data.c:10:
D:\MATLAB\R2018a\extern\include/covrt.h:318:5: error: unknown type name 'size_t'
size_t stateCnt,
^
D:\MATLAB\R2018a\extern\include/covrt.h:320:5: error: unknown type name 'size_t'
size_t transCnt);
^
D:\MATLAB\R2018a\extern\include/covrt.h:324:51: error: unknown type name 'size_t'
size_t size);
^
gmake: *** [Bayer_2Step_data.o] Error 1

Accepted Answer

Walter Roberson
Walter Roberson on 28 Jun 2018
"Please notice that there are some '/' which should be '\' in those paths. How to correct those '/'?"
No, those do not need to be changed. MS Windows uses / internally as the directory separator, but changes that to \ for display purposes. (The use of \ for display has to do with the fact that they did not want to have conflicts with the user of / for command line switches when they were designing directories back in the early MS DOS days, but the code itself was designed to use / )
The only time you must use \ instead of / is if you are using some of the old old DOS commands that assumed that command line switches could appear anywhere including immediately after a filename.
  3 Comments
Walter Roberson
Walter Roberson on 28 Jun 2018
I do not see any error about .h not being found.
In order to get the error message
In file included from C:/TDM-GCC-64/x86_64-w64-mingw32/include/stddef.h:7:0,
from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/stddef.h:1,
from C:\MinGW\include/stdio.h:69,
from Bayer_2Step.h:13,
from Bayer_2Step_data.c:10:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:35:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
__MINGW_EXTENSION typedef unsigned __int64 size_t;
^
then the files
C:/TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h
C:/TDM-GCC-64/x86_64-w64-mingw32/include/stddef.h
C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/stddef.h
C:\MinGW\include/stdio.h
Bayer_2Step.h
Bayer_2Step_data.c
all had to be found.
The message is complaining about a problem processing the line
__MINGW_EXTENSION typedef unsigned __int64 size_t;
saying that it expected something between the _MINGW_EXTENSION and the typedef -- in particular it expected an equal sign, a comma, a semi-colon, the word asm or the word __attribute_ .
Because of the error, size_t ends up not getting defined, and that triggers a number of other messages.
There are a few different ways this could happen. One of them is if somehow __MINGW_EXTENSION is not recognized as being defined and is being treated as the name of a variable. Another way is if you (or one of the files you included) missed an #endif -- one poster with a related problem accidentally used endif instead of #endif for example.
Dawn Pan
Dawn Pan on 29 Jun 2018
Thanks for your enthusiasm. I copied my project into a computer with MATLAB 2016a then the error was disappeared. Maybe there's something wrong with the compile environment in my computer.

Sign in to comment.

More Answers (0)

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!