How do I disable the unsupported compiler warning message generated by the MEX command in MATLAB 7.13 (R2011b)?

3 次查看(过去 30 天)
I am using GCC 4.4.1, which is an unsupported compiler for MATLAB 7.13 (R2011b). When I type the following command in MATLAB
mex yprime.c
I receive a warning message:
Warning: You are using gcc version "4.4.1". The version
currently supported with MEX is "4.3.4".
For a list of currently supported compilers see:
<http://www.mathworks.com/support/compilers/current_release/>
I tried to disable this warning using the following MATLAB command
warning off last
but receive an error message:
Error using warning
The last warning issued had an empty warning identifier, or no
warnings have yet been issued.
I would like to disable this warning message.

采纳的回答

MathWorks Support Team
The ability to suppress this warning message is not available inside MATLAB.
To work around this issue,
1. Open the file named "mex" found in the $MATLABROOT/bin directory, where $MATLABROOT is the MATLAB root directory on your machine, as returned by executing the following at the MATLAB Command Prompt:
matlabroot
2. Navigate to Lines 402-409 of the file. The error message is being printed from the if-statement contained on these lines:
if (need_to_warn == 1)
{
printf("\n");
printf("Warning: You are using gcc version \"%s\". The version\n", version_number);
printf(" currently supported with %s is \"%s\".\n", toolName, versions[2]);
printf(" For a list of currently supported compilers see: \n");
printf(" <http://www.mathworks.com/support/compilers/current_release/\n\n http://www.mathworks.com/support/compilers/current_release/\n\n">);
}
Commenting the above lines of code will suppress the warning in MATLAB.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2011b

Community Treasure Hunt

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

Start Hunting!

Translated by