Scroll to navigation

SWIG(1) General Commands Manual SWIG(1)

NAME

swig - Simplified Wrapper and Interface Generator

SYNOPSIS

swig [options] file

DESCRIPTION

The swig command is used to create wrapper code to connect C and C++ code to scripting languages like Perl, Python, Tcl etc. from the definition of the interface. For detailed information on writing those interface definitions please refer to /usr/share/doc/swig-doc-2.0.9/Doc/Manual/index.html from the swig-doc package. This manpage concentrates on explaining the invocation of the swig command.

OPTIONS

Target Language Options:

Generate ALLEGROCL wrappers
Generate CHICKEN wrappers
Generate CLISP wrappers
Generate CFFI wrappers
Generate C# wrappers
Generate D wrappers
Generate Go wrappers
Generate Guile wrappers
Generate Java wrappers
Generate Lua wrappers
Generate Modula 3 wrappers
Generate Mzscheme wrappers
Generate Ocaml wrappers
Generate Octave wrappers
Generate Perl wrappers
Generate PHP wrappers
Generate Pike wrappers
Generate Python wrappers
Generate R (aka GNU S) wrappers
Generate Ruby wrappers
Generate Lisp S-Expressions wrappers
Generate Tcl wrappers
Generate Common Lisp / UFFI wrappers
Generate XML wrappers i

General Options:

Add extra extern declarations
Enable C++ processing
Check file out of the SWIG library
Automatically generate copy constructors wherever possible
Treat the preprocessor #error statement as #warning (default)
Display copyright notices
Display information about the classes found in the interface
Display module parse tree at stages 1-4, n is a csv list of stages
Display symbol tables information
Display target language symbols in the symbol tables
Display C symbols in the symbol tables
Display target language layer symbols
Display information about the tags found in the interface
Display information for debugging templates
Display entire parse tree at stages 1-4, n is a csv list of stages
Display information about the types and typedefs in the interface
Display typemap debugging information
Display typemap search debugging information
Display typemaps used debugging information
Turn on director mode for all the classes, mainly for testing
Turn on wrapping of protected members for director classes (default)
Define a symbol symbol (for conditional compilation)
Preprocess only, does not generate wrapper code
Export the SWIG runtime stack
Make SWIG fake the program version number to v
Compile in compact mode
Set global features, where list is a comma separated list of features, eg -features directors,autodoc=1 If no explicit value is given to the feature, a default of 1 is used
Enable fast dispatch mode to produce faster overload dispatcher code
Display error/warning messages in Microsoft format
Display error/warning messages in commonly used format
Compile in virtual elimination mode
This output
Don't search the current directory
Look for SWIG files in directory dir
Ignore missing include files
Follow all #include statements as imports
Follow all #include statements
Include SWIG library file ifile
Report errors inside macros
Create default constructors/destructors (the default)
List all dependencies
Is equivalent to ’-M -MF file’, except ’-E’ is not implied
Generate dependencies into file and continue generating wrappers
List dependencies, but omit files in SWIG library
Like ’-MD’, but omit files in SWIG library
Set module name to name
Generate phony targets for all dependencies
Set the target of the rule emitted by dependency generation
Turn off contract checking
Do not treat the preprocessor #error statement as #warning
Do not generate default constructors nor default destructors
Do not generate implicit default constructors
Do not generate implicit default destructors
Do not wrap director protected members
Do not wrap exception specifiers
Disable fast dispatch mode (default)
Skip the preprocessor step
Disable reduction of the typedefs in templates
Enable the optimization options: -fastdispatch -fvirtual
Set name of the output file to outfile
Set name of the output header file to headfile
Set default output dir to current dir instead of input file's path
Set language specific files output directory to dir
Display PCRE version information
Compile in virtual elimination & compact mode
Report location of SWIG library and exit
Reduce all the typedefs in templates
Run in verbose mode
Display SWIG version number
Remove all warning suppression, also implies -Wextra
Enable keyword warnings for all the supported languages
Treat warnings as errors
Adds the following additional warnings: 202,309,403,512,321,322
Suppress/add warning messages, eg -w401,+321 see Warnings.html
Write XML version of the parse tree to file after normal processing

Tcl 8 Options (available with -tcl)

Enable ITcl support
Leave out SafeInit module function.
Set a prefix name to be prepended to all names
Build module into a Tcl 8 namespace
Set package version

Note: 'swig -lang -help' displays options for a specific target language.

AUTHOR

SWIG was originally created by David Beazley. For up-to-date information about authors and contributors please check http://www.swig.org/guilty.html. This manual page was written by Torsten Landschoff <torsten@debian.org> and updated by Jitka Plesnikova <jplesnik@redhat.com> (but may be used by others).

2013-05-24