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

gmakeMATLABmatlab codermex

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);
^

Best Answer

"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.