SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. http://www.swig.org
  • SWIG 39.9%
  • C++ 34.4%
  • C 16.4%
  • Yacc 5.5%
  • M4 1.8%
  • Other 1.8%
Find a file
Olly Betts 2059ebfdd0 CI: Remove continue-on-error from PHP 8.6 job
It was marked like this as we were testing release candidates, but PHP
8.6 has now been released.
2026-12-01 08:05:37 +13:00
.agents/skills Fail on a skipped heading level or a second H1 in makechap.py 2026-11-16 19:10:30 +00:00
.claude/skills AGENTS.md: put the rules first and add the swig-contribute skill 2026-10-28 08:00:25 +00:00
.github CI: Remove continue-on-error from PHP 8.6 job 2026-12-01 08:05:37 +13:00
CCache [ccache-swig] Don't pass -c as well as -E in the cpp call test 2026-08-01 09:42:44 +01:00
Doc [Python] Qualify the str builtin hidden by a str member in annotations 2026-11-21 22:34:04 +00:00
Examples [Python] Fix freeing an instance of a Python subclass of SwigPyObject 2026-11-26 17:08:08 +00:00
Lib [Python] Fix seg fault if a SWIG runtime Python type cannot be created 2026-11-26 17:08:22 +00:00
Source [Python] Qualify the str builtin hidden by a str member in annotations 2026-11-21 22:34:04 +00:00
Tools Replace 'ppa:ondrej/php' with 'packages.sury.org' PHP 2026-12-01 08:05:22 +13:00
Win The great merge 2002-11-30 22:01:28 +00:00
.git-blame-ignore-revs Allow easily ignoring clang-format commit when running git-blame (#3517) 2026-07-30 08:29:49 +01:00
.gitattributes Add .gitattributes file 2013-05-12 19:14:59 +01:00
.gitignore Ignore the generated Python .pyi stub files 2026-09-16 23:38:05 +01:00
AGENTS.md Correct the developer documentation in Doc/Devel 2026-10-28 08:45:56 +00:00
ANNOUNCE Bump version to 4.6.0 2026-08-07 07:50:12 +01:00
autogen.sh update some comments 2008-11-07 21:25:31 +00:00
CHANGES 4.5.1 release notes from the release-4.5 branch 2026-09-10 21:34:38 +01:00
CHANGES.current Reword the CHANGES.current entry for #3061 and add a summary entry 2026-11-26 17:08:22 +00:00
CMakeLists.txt CMake: fix the macOS build mixing up the PCRE2 header and library 2026-10-29 22:05:52 +00:00
configure.ac Don't probe for unsupported versions of Python in configure 2026-09-16 23:38:05 +01:00
CONTRIBUTING.md Add CONTRIBUTING.md and a pull request template 2026-10-28 08:00:25 +00:00
COPYRIGHT Merge branch 'master' into C 2024-03-18 09:09:51 +13:00
INSTALL The great merge 2002-11-30 22:01:28 +00:00
LICENSE merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
LICENSE-GPL merge revisions 11872:11876 from trunk to gsoc2009-sploving branch - license changes 2010-03-06 01:19:37 +00:00
LICENSE-UNIVERSITIES Fix grammatical error introduced by previous fix. 2010-06-21 03:37:08 +00:00
Makefile.in Add a check-warnings make target 2026-09-30 08:25:32 +01:00
preinst-swig.in Stop preinst-swig.in from being executable 2016-05-22 18:59:00 +12:00
README Add CONTRIBUTING.md and a pull request template 2026-10-28 08:00:25 +00:00
RELEASENOTES 4.5.1 release notes from the release-4.5 branch 2026-09-10 21:34:38 +01:00
TODO [MzScheme/Racket] Drop support 2025-04-01 14:05:28 +13:00

SWIG (Simplified Wrapper and Interface Generator)

Tagline: SWIG is a compiler that integrates C and C++ with languages
         including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua,
         Octave, R, Scheme (Guile), Scilab, Ocaml.
         SWIG can also export its parse tree into XML.

SWIG reads annotated C/C++ header files and creates wrapper code (glue
code) in order to make the corresponding C/C++ libraries available to
the listed languages, or to extend C/C++ programs with a scripting
language.

Up-to-date SWIG related information can be found at

        https://www.swig.org

A SWIG FAQ and other hints can be found on the SWIG Wiki:

        https://github.com/swig/swig/wiki

License
=======
Please see the LICENSE file for details of the SWIG license. For
further insight into the license including the license of SWIG's
output code, please visit

        https://www.swig.org/legal.html

Release Notes
=============
Please see the CHANGES.current file for a detailed list of bug fixes and
new features for the current release. The CHANGES file contains bug fixes
and new features for older versions. A summary of changes in each release
can be found in the RELEASENOTES file.

Documentation
=============
The Doc/Manual directory contains the most recent set of updated
documentation for this release. The documentation is available in
three different formats, each of which contains identical content.
These format are, pdf (Doc/Manual/SWIGDocumentation.pdf), single
page html (Doc/Manual/SWIGDocumentation.html) or multiple page html
(other files in Doc/Manual). Please select your chosen format and
copy/install to wherever takes your fancy.

There is some technical developer documentation available in the
Doc/Devel subdirectory.  This is not necessarily up-to-date, but it
has some information on SWIG internals.

Documentation is also online at https://www.swig.org/doc.html.

Backwards Compatibility
=======================
The developers strive their best to preserve backwards compatibility
between releases, but this is not always possible as the overriding
aim is to provide the best wrapping experience. Where backwards
compatibility is known to be broken, it is clearly marked as an
incompatibility in the CHANGES and CHANGES.current files.

See the documentation for details of the SWIG_VERSION preprocessor
symbol if you have backward compatibility issues and need to use more
than one version of SWIG.

Installation
============
Please read the Doc/Manual/Preface.html#Preface_installation for
full installation instructions for Windows, Unix and Mac OS X
using the release tarball/zip file. The INSTALL file has generic
build and installation instructions for Unix users.
Users wishing to build and install code from Github should
visit https://swig.org/svn.html to obtain the more detailed
instructions required for building code obtained from Github - extra
steps are required compared to building from the release tarball.

Testing
=======
The typical 'make -k check' can be performed on Unix operating systems.
Please read Doc/Manual/Preface.html#Preface_testing for details.

Examples
========
The Examples directory contains a variety of examples of using SWIG
and it has some browsable documentation.  Simply point your browser to
the file "Example/index.html".

The Examples directory also includes Visual C++ project 6 (.dsp) files for
building some of the examples on Windows. Later versions of Visual Studio
will convert these old style project files into a current solution file.

Known Issues
============
There are minor known bugs, details of which are in the bug tracker, see
https://www.swig.org/bugs.html.

Troubleshooting
===============
In order to operate correctly, SWIG relies upon a set of library
files.  If after building SWIG, you get error messages like this,

    $ swig foo.i
    :1. Unable to find 'swig.swg'
    :3. Unable to find 'tcl8.swg'

it means that SWIG has either been incorrectly configured or
installed.  To fix this:

    1.  Make sure you remembered to do a 'make install' and that
        the installation actually worked.  Make sure you have
        write permission on the install directory.

    2.  If that doesn't work, type 'swig -swiglib' to find out
        where SWIG thinks its library is located.

    3.  If the location is not where you expect, perhaps
        you supplied a bad option to configure.  Use
        ./configure --prefix=pathname to set the SWIG install
        location.   Also, make sure you don't include a shell
        escape character such as ~ when you specify the path.

    4.  The SWIG library can be changed by setting the SWIG_LIB
        environment variable.  However, you really shouldn't
        have to do this.

If you are having other troubles, you might look at the SWIG Wiki at
https://github.com/swig/swig/wiki.

Participate!
============
Please report any errors and submit patches (if possible)!  We only
have access to a limited variety of hardware (Linux, Solaris, OS-X,
and Windows). All contributions help.

Please read CONTRIBUTING.md before opening a pull request. It covers
building from git, testing, CI etiquette and using AI tools, which are
welcome.

If you would like to join the SWIG development team or contribute a
language module to the distribution, please contact the swig-devel
mailing list, details at https://www.swig.org/mail.html.


 -- The SWIG Maintainers