MATLAB COMPILER RELEASE NOTES Guide de l'utilisateur Page 153

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 264
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 152
Including M-File Information in Compiler Output
5-37
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.
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 5 points to lines in the C code that were produced by line 5 of the M-file, or
fprintf(1,'Hello, World\n' );
.
#line 1 "<matlab>\\extern\\examples\\compiler\\hello.m"
static void Mhello(void) {
#line 1 "<matlab>\\extern\\examples\\compiler\\hello.m"
mxArray * ans = mclGetUninitializedArray();
/*
* % This is the hello, world function written in M code
* % $Revision: 1.1 $
* %
* fprintf(1,'Hello, World\n' );
*/
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
mclAssignAns(
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
&ans,
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
mlfNFprintf(0, mlfScalar(1), mxCreateString("Hello, World\\n"), NULL));
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
mxDestroyArray(ans);
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
}
.
.
.
Line 1
Line 1
Line 5
Line 5
Line 5
Line 5
Line 5
Vue de la page 152
1 2 ... 148 149 150 151 152 153 154 155 156 157 158 ... 263 264

Commentaires sur ces manuels

Pas de commentaire