SWIG(1)
π NAME π
swig β Simplified Wrapper and Interface Generator β¨ iykyk, the name is literally the whole vibe.
πΈ SYNOPSIS πΈ
swig [options] file
π¦ DESCRIPTION π¦
okay so bestie, here's the tea β β the swig command makes wrapper code that hooks your C and C++ code up to scripting languages like Perl, Python, etc., all starting from the definition of the interface. That's the whole main character move.
If you want the detailed lore on how to actually write those interface definitions, go read /usr/share/doc/swig-doc/Manual/index.html from the swig-doc package. This manpage is not about that β it's concentrated on explaining the invocation of the swig command. Just the how-to-run-it part. periodt. π
β¨ OPTIONS β¨
π Supported Target Language Options
Pick your language, get your wrappers. Slay.
-csharpβ Generate C# wrappers-dβ Generate D wrappers-goβ Generate Go wrappers-guileβ Generate Guile wrappers-javaβ Generate Java wrappers-javascriptβ Generate Javascript wrappers-luaβ Generate Lua wrappers-octaveβ Generate Octave wrappers-perl5β Generate Perl 5 wrappers-php7β Generate PHP 8 or later wrappers-pythonβ Generate Python wrappers-rβ Generate R (aka GNU S) wrappers-rubyβ Generate Ruby wrappers-scilabβ Generate Scilab wrappers-tcl8β Generate Tcl 8 wrappers-xmlβ Generate XML wrappers
π§ͺ Experimental Target Language Options
these are the experimental girlies, tread accordingly π«Ά
-cβ Generate C wrappers-ocamlβ Generate OCaml wrappers
π General Options
-addexternβ Add extraexterndeclarations-c++β Enable C++ processing-co <file>β Check<file>out of the SWIG library-copyctorβ Automatically generate copy constructors wherever possible-cpperraswarnβ Treat the preprocessor#errorstatement as#warning(this is the default, no cap)-cppext <ext>β Change file extension of generated C++ files to<ext>(default iscxx)-copyrightβ Display copyright notices-debug-classesβ Display information about the classes found in the interface-debug-module <n>β Display module parse tree at stages 1-4,<n>is a csv list of stages-debug-symtabsβ Display symbol tables information-debug-symbolsβ Display target language symbols in the symbol tables-debug-csymbolsβ Display C symbols in the symbol tables-debug-lsymbolsβ Display target language layer symbols-debug-quietβ Display less parse tree node debug info when using other-debugoptions-debug-tagsβ Display information about the tags found in the interface-debug-templateβ Display information for debugging templates-debug-top <n>β Display entire parse tree at stages 1-4,<n>is a csv list of stages-debug-typedefβ Display information about the types and typedefs in the interface-debug-typemapβ Display typemap debugging information-debug-tmsearchβ Display typemap search debugging information-debug-tmusedβ Display typemaps used debugging information-directorsβ Turn on director mode for all the classes, mainly for testing-dirprotβ Turn on wrapping of protected members for director classes (default)-D<symbol>[=<value>]β Define symbol<symbol>(for conditional compilation)-Eβ Preprocess only, does not generate wrapper code-external-runtime [file]β Export the SWIG runtime stack-fakeversion <v>β Make SWIG fake the program version number to<v>-fcompactβ Compile in compact mode-features <list>β 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 of1is used-fastdispatchβ Enable fast dispatch mode to produce faster overload dispatcher code-Fmicrosoftβ Display error/warning messages in Microsoft format-Fstandardβ Display error/warning messages in commonly used format-fvirtualβ Compile in virtual elimination mode-helpβ Display help-I-β Don't search the current directory-I<dir>β Look for SWIG files in directory<dir>-ignoremissingβ Ignore missing include files-importallβ Follow all#includestatements as imports-includeallβ Follow all#includestatements-l<ifile>β Include SWIG library file<ifile>-macroerrorsβ Report errors inside macros-Mβ List all dependencies-MDβ Is equivalent to-M -MF <file>, except-Eis not implied-MF <file>β Generate dependencies into<file>and continue generating wrappers-MMβ List dependencies, but omit files in SWIG library-MMDβ Like-MD, but omit files in SWIG library-module <name>β Set module name to<name>-MPβ Generate phony targets for all dependencies-MT <target>β Set the target of the rule emitted by dependency generation-nocontractβ Turn off contract checking-nocpperraswarnβ Do not treat the preprocessor#errorstatement as#warning-nodefaultctorβ Do not generate implicit default constructors-nodefaultdtorβ Do not generate implicit default destructors-nodirprotβ Do not wrap director protected members-noexceptβ Do not wrap exception specifiers-nofastdispatchβ Disable fast dispatch mode (default)-nopreprocessβ Skip the preprocessor step-notemplatereduceβ Disable reduction of the typedefs in templates-Oβ Enable the optimization options:-fastdispatch-fvirtual-o <outfile>β Set name of C/C++ output file to<outfile>-oh <headfile>β Set name of C++ output header file for directors to<headfile>-outcurrentdirβ Set default output dir to current dir instead of input file's path-outdir <dir>β Set language specific files output directory to<dir>-pcreversionβ Display PCRE2 version information-smallβ Compile in virtual elimination and compact mode-std=<standard>β Set the C or C++ language<standard>for inputs-swiglibβ Report location of SWIG library and exit-templatereduceβ Reduce all the typedefs in templates-U<symbol>β Undefine symbol<symbol>-vβ Run in verbose mode-versionβ Display SWIG version number-Wallβ Remove all warning suppression, also implies-Wextra-Wallkwβ Enable keyword warnings for all the supported languages-Werrorβ Treat warnings as errors π-Wextraβ Adds the following additional warnings:309,403,405,512,321,322-w<list>β Suppress/add warning messages, eg-w401,+321β seeWarnings.html-xmlout <file>β Write XML version of the parse tree to<file>after normal processing
Options can also be defined using the SWIG_FEATURES environment variable, for example:
$ SWIG_FEATURES="-Wall"
$ export SWIG_FEATURES
$ swig -python interface.i
is equivalent to:
$ swig -Wall -python interface.i
Arguments may also be passed in a file, separated by whitespace. For example:
$ echo "-Wall -python interface.i" > args.txt
$ swig @args.txt
Note: swig -<lang> -help displays options for a specific target language. π«Ά
And for the record, the build you're reading about says:
SWIG Version 4.5.0
Compiled with x86_64-linux-gnu-g++ [x86_64-pc-linux-gnu]
Configured options: +pcre
Please see https://www.swig.org for reporting bugs and further information π
π 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 Rafael Laboissi??re <rafael@debain.org> for the Debian project (but may be used by others). iconic honestly π
π SEE ALSO π
For more information, see file /usr/share/doc/swig/Manual/SWIG.html from the swig-doc package. go read it bestie, it's giving comprehensive πβ¨
and that's the whole page, no notes π
this one is from the swig section of the manual, dated August 2026, and it's SWIG version page SWIG(1) β okay bye, go wrap something π¦ππ
π¦ where this page comes from
- ubuntu stonking: swig 4.5.0-3 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms