What do I receive syntax and escape sequence errors when using the -o option of the MATLAB Compiler 4.0 (R14)?

1 view (last 30 days)
When I try to compile my program using MCC and the "-o" option with MATLAB Compiler 4.0 (R14), I receive a number of error messages. For example, I compile with the following command:
mcc -m -v -W main -o C:\MyMatlab\Compiled_SeisLab_R14\SeisLab_with_command_window
However, the following error is thrown:
Error:
c__mymatlab_compiled_seislab_r14_seislab_with_command_window_main.c(14)
: error C2143: syntax error : missing '{' before ':'
c__mymatlab_compiled_seislab_r14_seislab_with_command_window_main.c(14)
: error C2059: syntax error : ':'
c__mymatlab_compiled_seislab_r14_seislab_with_command_window_main.c(14)
: error C2017: illegal escape sequence

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
These errors are due to the full path you specified to the "-o" option. The C code generated by the MATLAB Compiler used the name you specifed with "-o" for a function name. Since characters like ":" and "\" are not valid characters for function names, you received syntax and illegal character errors. The "-o" option takes only the name of the executable. You should use the "-d" option to place output in a specified directory
To accomplish this task, use the following command:
mcc -m -v -o SeisLab_with_command_windowSeislab_launcher1 -d C:\MyMatlab\Compiled_SeisLab_R14SeisLab_with_command_windowSeislab_launcher1

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!