ClangSharpPInvokeGenerator.linux-x64 21.1.8.4

Requires NuGet 4.3 or higher.

dotnet add package ClangSharpPInvokeGenerator.linux-x64 --version 21.1.8.4
                    
NuGet\Install-Package ClangSharpPInvokeGenerator.linux-x64 -Version 21.1.8.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ClangSharpPInvokeGenerator.linux-x64" Version="21.1.8.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ClangSharpPInvokeGenerator.linux-x64" Version="21.1.8.4" />
                    
Directory.Packages.props
<PackageReference Include="ClangSharpPInvokeGenerator.linux-x64" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ClangSharpPInvokeGenerator.linux-x64 --version 21.1.8.4
                    
#r "nuget: ClangSharpPInvokeGenerator.linux-x64, 21.1.8.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ClangSharpPInvokeGenerator.linux-x64@21.1.8.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ClangSharpPInvokeGenerator.linux-x64&version=21.1.8.4
                    
Install as a Cake Addin
#tool nuget:?package=ClangSharpPInvokeGenerator.linux-x64&version=21.1.8.4
                    
Install as a Cake Tool

ClangSharpPInvokeGenerator

ClangSharpPInvokeGenerator is a .NET tool that generates strongly-typed C#/.NET P/Invoke bindings from C and C++ header files by parsing them with libclang. It is part of the ClangSharp project, which is self-hosted and uses this tool to auto-generate its own bindings.

Installing

Install the generator as a global .NET tool:

dotnet tool install --global ClangSharpPInvokeGenerator

NOTE: The generator depends on the native libClang and libClangSharp libraries. When running as a .NET tool, you may need to manually copy the appropriate native DLLs from the libClang and libClangSharp packages due to limitations in the .NET tool support. See #46 and #118 for details.

Usage

At a minimum, the tool expects one or more input files (-f), an output namespace (-n), and an output location (-o):

ClangSharpPInvokeGenerator -f example.h -n Example.Namespace -o Example.cs

The simplest and recommended setup is to use a response file, which lets you specify and check in the command line arguments in a text file with one argument per line:

ClangSharpPInvokeGenerator @generate.rsp

See GenerateClang.rsp for a real-world example. A typical response file also specifies explicit files to traverse, configuration options, name remappings, and other fixups.

You can see the full set of available switches by passing --help, and the available configuration options by passing -c help.

More information

License

Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See LICENSE.md in the repository root for more information.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
21.1.8.4 27 7/15/2026
21.1.8.3 5,675 3/23/2026
21.1.8.2 590 1/16/2026
21.1.8 338 1/5/2026
20.1.2.4 3,868 10/15/2025
20.1.2.3 531 9/1/2025
20.1.2.2 504 8/19/2025