Open sandeepganji opened 4 years ago
The sample file is there to allow the user to see how a colour scheme looks. It is intended to show all syntax highlighting options in a single succinct file. This line is intentionally not terminated in order to demonstrate what an unterminated string looks like, hence why the text for the sting is the word "unterminated". So it's not a bug, it is a feature. This is not a file that you need to run in order to use any of the functionality of the package, and so you should not be attempting to compile it.
But why are trying to compile the code with mcc in the first place? Is this something MATLAB is doing automatically on your behalf, or is there some motivation for you to manually compile the package?
I can actually support @sandeepganji's use case here: At my work, and in my contracting gigs, I often "compile" Matlab code to deployable programs or libraries using the Matlab Compiler (mcc), so they can be run by users that don't have Matlab licenses, run in the Matlab Production Server or Matlab Parallel Server, included in custom applications in C# or other languages, distributed in an obfuscated, no-Matlab-license-required manner, and so on.
For larger Matlab applications, using depfun
and Matlab Compiler's automatic dependency resolution to pick up the source files to go in to the mcc
program is not adequate: it misses any dynamic dependencies used by eval
, feval
, or other dynamic dispatch mechanisms, and it doesn't pick up resource files. The easiest way to deal with this is to must use the -a
option to sweep up your entire codebase, including any third-party libraries you're using, which is probably where Sandeep's pulling in Matlab Schemer. Multiple Matlab Compiler libraries cannot be composed together, so you need to compile the whole shebang, including all your dependencies, at once.
Regardless of how you do it, any syntax error in any .m
file that's included in an mcc
build will break the entire build, regardless of whether that file actually gets called anywhere.
The straightforward fix to this is to not have the develop/
directory on your Matlab path
when you're running mcc
. Is that feasible, @sandeepganji ?
In develop\sample.m
fprintf(fid, '%d unterminated\n, i);
is not properly terminated. this can accuse issues in mcc (code compilation)