From: feng cheng on
Hello,

when I use matlab under Ubuntu system to compile a program, it failed (see below reports). Could someone help me to figure the problem out? Thank you!

The test.m is a simple test mfile:
-------------------------------------------
function test( varargin )

a = varargin{1};
b = a + 1;
disp( b );

-------------------------------------------
>> mcc -m test.m
test_main.c:6:19: error: stdio.h: No such file or directory
In file included from test_main.c:7:
/usr/matlab/extern/include/mclmcrrt.h:54:21: error: stdint.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.1.3/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-linux-gnu/4.1.3/include/limits.h:11,
from /usr/matlab/extern/include/tmwtypes.h:43,
from /usr/matlab/extern/include/matrix.h:305,
from /usr/matlab/extern/include/mat.h:55,
from /usr/matlab/extern/include/mclmcrrt.h:159,
from test_main.c:7:
/usr/lib/gcc/x86_64-linux-gnu/4.1.3/include/limits.h:122:61: error: limits.h: No such file or directory
In file included from /usr/matlab/extern/include/mat.h:55,
from /usr/matlab/extern/include/mclmcrrt.h:159,
from test_main.c:7:
/usr/matlab/extern/include/matrix.h:953:20: error: stdlib.h: No such file or directory
/usr/matlab/extern/include/matrix.h:1273:22: error: assert.h: No such file or directory
In file included from /usr/matlab/extern/include/mclmcrrt.h:159,
from test_main.c:7:
/usr/matlab/extern/include/mat.h:90: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from test_main.c:7:
/usr/matlab/extern/include/mclmcrrt.h:189: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from /usr/matlab/extern/include/mclmcrrt.h:1688,
from test_main.c:7:
/usr/matlab/extern/include/mclmcr.h:86:20: error: string.h: No such file or directory
/usr/matlab/extern/include/mclmcr.h:87:19: error: wchar.h: No such file or directory
In file included from /usr/matlab/extern/include/mclmcrrt.h:1688,
from test_main.c:7:
/usr/matlab/extern/include/mclmcr.h:362: error: expected specifier-qualifier-list before ‘int32_t’
/usr/matlab/extern/include/mclmcr.h:378: error: expected declaration specifiers or ‘...’ before ‘int32_t’
/usr/matlab/extern/include/mclmcr.h:379: error: expected declaration specifiers or ‘...’ before ‘int32_t’
/usr/matlab/extern/include/mclmcr.h:382: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘utf16_strlen_fcn_proxy’
/usr/matlab/extern/include/mclmcr.h:385: error: expected declaration specifiers or ‘...’ before ‘int32_t’
/usr/matlab/extern/include/mclmcr.h:597: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘mxInt64’
/usr/matlab/extern/include/mclmcr.h:598: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘mxUint64’
/usr/matlab/extern/include/mclmcr.h:1423: error: expected declaration specifiers or ‘...’ before ‘mxInt64’
/usr/matlab/extern/include/mclmcr.h:1423: error: expected declaration specifiers or ‘...’ before ‘mxInt64’
/usr/matlab/extern/include/mclmcr.h:1426: error: expected declaration specifiers or ‘...’ before ‘mxUint64’
/usr/matlab/extern/include/mclmcr.h:1426: error: expected declaration specifiers or ‘...’ before ‘mxUint64’
In file included from test_main.c:7:
/usr/matlab/extern/include/mclmcrrt.h:2306: error: expected declaration specifiers or ‘...’ before ‘mxUint64’
/usr/matlab/extern/include/mclmcrrt.h:2306: error: expected declaration specifiers or ‘...’ before ‘mxUint64’
/usr/matlab/extern/include/mclmcrrt.h:2498: error: expected declaration specifiers or ‘...’ before ‘int32_t’
/usr/matlab/extern/include/mclmcrrt.h:2600: error: expected declaration specifiers or ‘...’ before ‘mxInt64’
/usr/matlab/extern/include/mclmcrrt.h:2600: error: expected declaration specifiers or ‘...’ before ‘mxInt64’
/usr/matlab/extern/include/mclmcrrt.h:2640: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘utf16_strlen_fcn_proxy’
/usr/matlab/extern/include/mclmcrrt.h:2687: error: expected declaration specifiers or ‘...’ before ‘int32_t’
/usr/matlab/extern/include/mclmcrrt.h:2688: error: expected declaration specifiers or ‘...’ before ‘int32_t’
test_main.c: In function ‘mclDefaultPrintHandler’:
test_main.c:26: warning: incompatible implicit declaration of built-in function ‘strlen’
test_main.c: In function ‘mclDefaultErrorHandler’:
test_main.c:41: warning: incompatible implicit declaration of built-in function ‘strlen’

mbuild: compile of ' "test_main.c"' failed.

Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable (specify the -v option for more information).
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).
------------------------------------------------------

Thank you for your help!