Printer
GetIncludes
get library inclusion statements
Calling Sequence
Parameters
Description
Examples
Printer:-GetIncludes()
-
Printer module
When called after the printing of intermediate code, the GetIncludes command returns a string containing the commands necessary for including all libraries or packages which have been declared necessary during the printing phase with AddLibrary calls.
The LibraryInclusion language attribute controls the formatting of the results returned by GetIncludes.
The GetIncludes command is frequently called by PrintTarget in order to preface the generated code with any necessary include directives.
with⁡CodeGeneration:
LanguageDefinition[Define]("GetIncludesExample", extend = "C", AddFunction( "show_libraries", [anything]::anything, proc() Printer:-Print( "printf(\"Library inclusion statements are: ", Printer:-GetIncludes(), "\")" ) end proc ) ):
Translate⁡a=sin⁡x,b=show_libraries⁡,language=GetIncludesExample
a = sin(x); b = (double) printf("Library inclusion statements are: #include <math.h> ");
See Also
AddLibrary
Language Attributes
Download Help Document