CppSharp 0.10.4

CppSharp is a tool and set of libraries which allows programmers to use C/C++ libraries with high-level programming languages (such as C#).

It is a tool that takes C/C++ header and library files and generates the necessary glue to surface the native API as a managed API. Such an API can be used to consume an existing native library in your high-level code or add scripting support to a native codebase.

The supported target languages at present are C# and C++/CLI.

It can also be used as a library to parse native code into a syntax tree with a rich declaration and type information model.

The NuGet version is Windows 64-bit only for the time being. Binary 32-bit releases for Windows can be found at https://github.com/mono/CppSharp/releases .

Install-Package CppSharp -Version 0.10.4
dotnet add package CppSharp --version 0.10.4
<PackageReference Include="CppSharp" Version="0.10.4">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CppSharp --version 0.10.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

* Simplify the required headers for macOS bindings

* Option to allow caller to specify it does not want unchanged output files to be modified. This supports incremental build in VS. (#1373) - Ali Alamiri <ali.alamiri@sage.com>

* CreateInstance factory overload to pass flag informing wrapper if it should own the native pointer passed to it. - Ali Alamiri <ali.alamiri@sage.com>

* force bash use to avoid `./premake5-linux: 3: ./premake5-linux: Bad substitution` error if other default shell in the system - Lorenzo Delana <lorenzo.delana@gmail.com>

* Made the original virtual tables static too

* Pass native pointers to bases in the generated C#

* Check type maps when printing C++ for pointers

* Do not add type alias templates twice to the AST

* Fix all leaks of memory in the old expressions

* Add template functions to their context

* Fix leaking memory by removing a useless assignment

* Fix leaking the memory of an entire Clang AST

* Ignore type maps when printing C++ for symbols

* Implement more accurate managed type printing in C++ type printer.

* Use a native type printer context when looking for type maps in CSharpSourcesExtensions.DisableTypeMap.

* Use explicit type printer when printing types in C# GenerateMethodSpecifier.

* Refactor CodeGenerator.GenerateMethodSpecifier to allow explicit specifier kind.

* Do not check declaration access for explicitly generated declarations.

* Fix TranslationUnit.FileRelativeDirectory to be more robust against null include paths.

* Fix formatting to of Declaration.GenerationKind to ease debugging.

* Ignore implicitly deleted copy constructor methods.

* Correctly marshal constant arrays in C++/CLI (#1346)

* Marshal pointer to primitive typedefs in C++/CLI (#1355) - Ali Alamiri <ali.alamiri@sage.com>

* Fix a regression when renaming classes

* Fix naming conflicts with nested types and members

* publish the clang lib folder - Ali Alamiri <ali.alamiri@sage.com>

* Implement basic support for parsing function-like macros.

* Implement TranslationUnit.ToString() to help with debugging.

* Add debug option and flags to the Premake build and compile scripts.

* Generate valid C# for parameters typedef-ed to mapped types

* Update the version of Mono used for builds (CI)

* Fix the regressed C# marshalling of char*

* Handle pointer to pointer param (#1343) - Ali Alamiri <ali.alamiri@sage.com>

* Handle returned pointers to std::vector in C++/CLI - Ali Alamiri <ali.alamiri@sage.com>

* Implement abstract templates to call virtuals

* Correctly align printed information for debugging

* Set the render kind of inline command comments

* Fix all memory leaks in tests

* Generate by ref parameters of type a pointer to enum

* Use UnsupportedType description for type name instead of empty string (#1339) - Ali Alamiri <ali.alamiri@sage.com>

Showing the top 3 GitHub repositories that depend on CppSharp:

Repository Stars
Ruslan-B/FFmpeg.AutoGen
FFmpeg auto generated unsafe bindings for C#/.NET and Mono.
ddobrev/QtSharp
Mono/.NET bindings for Qt
allisterb/jemalloc.NET
A native memory manager for .NET

Read more about the GitHub Usage information on our documentation.

Version History

Version Downloads Last updated
0.10.4 70 5/23/2020
0.10.3 497 4/9/2020
0.10.2 394 3/28/2020
0.10.1 4,257 7/4/2019
0.10.0 313 6/25/2019
0.9.2 681 5/7/2019
0.9.1 448 4/13/2019
0.9.0 1,680 3/1/2019
0.8.23 441 1/31/2019
0.8.22 2,141 9/24/2018
0.8.21 916 8/1/2018
0.8.20 792 5/25/2018
0.8.19 1,315 2/4/2018
0.8.18 1,295 1/27/2018
0.8.17 707 12/25/2017
0.8.16 772 11/10/2017
0.8.15 387 11/7/2017
0.8.14 1,415 9/17/2017
0.8.13 826 7/18/2017
0.8.12 358 7/18/2017
0.8.11 990 6/4/2017
0.8.10 850 4/23/2017
0.8.9 480 4/16/2017
0.8.8 411 4/9/2017
0.8.7 573 3/27/2017
0.8.6 687 3/4/2017
0.8.5 405 3/4/2017
0.8.4 1,245 2/10/2017
0.8.3 453 2/5/2017
0.8.2 463 1/25/2017
0.8.1 452 1/22/2017
0.8.0 464 1/22/2017
0.7.13 506 1/16/2017
0.7.12 658 11/17/2016
0.7.11 404 11/13/2016
0.7.10 393 11/11/2016
0.7.9 407 11/2/2016
0.7.8 402 11/1/2016
0.7.7 384 11/1/2016
0.7.6 441 10/28/2016
0.7.5 416 10/27/2016
0.7.4 434 10/25/2016
0.7.3 480 10/1/2016
0.7.2 493 9/17/2016
0.7.1 404 9/13/2016
0.7.0 378 9/12/2016
0.6.0 486 6/24/2016
0.5.2 530 6/17/2016
0.5.1 435 6/17/2016
0.5.0 501 6/14/2016