MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Podręcznik Użytkownika Strona 169

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 168
Including M-File Information in Compiler Output
5-43
Note When using the #line directive, the page-width directive is disabled in
order to make the code work properly with the C debugger.
Include #line Directives
To include #line directives in your generated C or C++ code, use
mcc -A line:on
The Hello, World example produces the following code segment when this
option is selected. (Note that several lines have been truncated for readability.)
#line 1 "D:\\work\\hello.m" /* Line 1 */
static void Mhello(void) {
#line 1 "D:\\work\\hello.m" /* Line 1 */
mclMlineEnterFunction("D:\\work\\hello.m", "hello")
#line 1 "D:\\work\\hello.m" /* Line 1 */
mexLocalFunctionTable save_local_function_table_ = -->
#line 1 "D:\\work\\hello.m" /* Line 1 */
mxArray * ans = NULL;
/*
* % This is the hello, world function written in M code
* fprintf(1,'Hello, World\n' );
*/
#line 3 "D:\\work\\hello.m" /* Line 3 */
mclMline(3);
#line 3 "D:\\work\\hello.m" /* Line 3 */
mclAssignAns(&ans, mlfNFprintf(0, mlfScalar(1), mxCreateString("Hello,-->
#line 3 "D:\\work\\hello.m" /* Line 3 */
mxDestroyArray(ans);
#line 3 "D:\\work\\hello.m" /* Line 3 */
mclSetCurrentLocalFunctionTable(save_local_function_table_);
#line 3 "D:\\work\\hello.m" /* Line 3 */
mclMlineExitFunction();
#line 3 "D:\\work\\hello.m" /* Line 3 */
}
In this example, Line 1 points to lines in the generated C code that were
produced by line 1 from the M-file, that is
function hello
Line 3 points to lines in the C code that were produced by line 3 of the M-file, or
fprintf(1,'Hello, World\n' );
Przeglądanie stron 168
1 2 ... 164 165 166 167 168 169 170 171 172 173 174 ... 273 274

Komentarze do niniejszej Instrukcji

Brak uwag

LiquiFix Unknown user manuals

The list of LiquiFix Unknown products contains 2 user manuals for 2 models. All pdf user’s guides are available for download or viewing online.

Click on an alphabet below to scroll to the full list of models starting with that letter

Models Document Type
400104
Installation Guide   LiquiFix 400104 Installation Guide, 1 pages
400185
Instruction Manual   LiquiFix 400185 Instructions / Assembly, 1 pages