百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

CppSharp

> 编程语言
开源

用于将 C/C++ API 粘合到高级语言的工具和库

3.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于将 C/C++ API 粘合到高级语言的工具和库

CppSharp is a tool and set of libraries which facilitates the usage of native C/C++ code with the .NET ecosystem.

It consumes C/C++ header and library files and generates the necessary glue code to surface the native API as a managed API. Such an API can be used to consume an existing native library in your managed code or add managed 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.

Releases/Build Status

NuGet Packages Continuous Integration
  1. Libraries
  2. Documentation
  3. Community
  4. Support
  5. Users

Libraries

AST

Mirrors the Clang's C/C++ AST and type system classes in C# APIs.

Check out Clang's AST introduction docs for more details about its architecture.

  • C++ declarations
  • C++ statements / expressions
  • C++ types
  • Class object layout
  • Declaration visitors
  • Type visitors

Parser

Provides APIs for parsing of C/C++ source code into a syntax tree.

  • Parsing of C/C++ source code
  • Parsing of libraries archives symbols
  • Parsing of shared libraries symbols
  • Based on the very accurate Clang C++ parser.

Generator

Generates the glue binding code from a syntax tree of the native code.

  • Multiple backends: C++/CLI and C# (P/Invoke)
  • Multiple ABIs: Itanium, MS, ARM, iOS
  • Multiple platforms: Windows, OS X and Linux
  • Multiple runtimes: .NET and Mono
  • C++ virtual methods overriding from managed code
  • C++ multiple inheritance by translating to C# interfaces
  • C++ std::string
  • C++ default parameter values
  • C/C++ semantic comments (Doxygen) to C# comments
  • Extensible bindings semantics via user passes and type mapping

Documentation

Please see the following resources for more information:

Getting Started

User's Manual

Developer's Manual

Community

Feel free to open up issues on GitHub for any problems you find.

Support

If you need commercial support feel free to open a discussion or issue for discussion.

Users

CppSharp is used by the following projects:

Kythera AI

QtSharp

MonoGame

LLDBSharp

Xamarin

FFMPEG.net

FFmpeg bindings

Tizen bindings

libgd bindings

ChakraSharp

FFmpeg.AutoGen

GLFW3.NET

DearImguiSharp

Please feel free to send us a pull request adding your own projects to the list above.

GitHub Issues· 346 开放

在 GitHub 查看全部
  • #1961

    Binding generates empty file for libalpm

    更新于 2026年3月6日
  • #1856

    GetUnixCompilerInfo fails on LANG=de_DE.UTF8

    更新于 2026年3月6日
  • #1708

    Building for mac m1(arm)

    更新于 2026年2月19日
  • #1957

    Segmentation fault when generating a wrapper for Qt code

    更新于 2025年12月5日
  • #1953

    Add support for linux-arm64

    更新于 2025年11月26日
  • #1951

    How to get started

    更新于 2025年11月22日
  • #1943

    Very old nuget version

    更新于 2025年9月25日
  • #1941

    Crashes after modifying LanguageVersion

    更新于 2025年7月5日
  • #1930

    CppSharp generates incorrect cast for `const char**` in `struct`

    更新于 2025年4月24日
  • #1935

    Inline friend-defined functions when the class is in a namespace

    更新于 2025年4月24日

核心特点

  • •C++ declarations
  • •C++ statements / expressions
  • •C++ types
  • •Class object layout
  • •Declaration visitors
  • •Type visitors
  • •Parsing of C/C++ source code
  • •Parsing of libraries archives symbols
  • •Parsing of shared libraries symbols
  • •Based on the very accurate Clang C++ parser.

> 标签

C#bindingsbridgecc-sharp

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言