Why do I receive compile time syntax errors when using MATLAB Compiler with the Builder products?

16 ビュー (過去 30 日間)
Why do I receive compile time syntax errors when using MATLAB Compiler with the Builder products?
When I try to compile the following segment of code:
function [out, stderr] = test(stdin)
disp('Hello World')
out = 1;
stderr = 'none';
using MATLAB Compiler as follows:
mcc -m test
I receive the following compile time error message:
test.c
h:\Documents\work\test.h(27) : error C2143: syntax error : missing ')' before '&'
h:\Documents\work\test.h(27) : error C2143: syntax error : missing ')' before '&'
[snip]
test.c(32) : error C2143: syntax error : missing ')' before '&'
test.c(32) : error C2143: syntax error : missing ')' before '&'
test.c(32) : error C2143: syntax error : missing '{' before '&'
test.c(32) : error C2059: syntax error : '&'
[snip]
test.c(96) : warning C4013: 'Mtest' undefined; assuming extern returning int
test.c(96) : warning C4047: '=' : 'mxArray *' differs in levels of indirection from 'int'
test.c(117) : error C2143: syntax error : missing ')' before '&'
test.c(117) : error C2143: syntax error : missing ')' before '&'
[snip]
MBUILD.BAT: Error: Compile of 'test.c' failed.
??? Error using ==> mbuild
Unable to complete successfully
??? Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable.
Error in ==> \\Pc2unix\ARCHIVE\R13\fcs\perfect\toolbox\compiler\mcc.dll

採用された回答

MathWorks Support Team
MathWorks Support Team 2010 年 1 月 22 日
These compile time errors are caused by the use of C/C++ keywords like stdin, stderr, etc. for variable names in your MATLAB code. To resolve this issue, you will need to rename these variable names to non-reserved keywords for C/C++ and MATLAB.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by