Tools and libraries to glue C/C++ APIs to high-level languages

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 GitHub Releases Continuous Integration
NuGet GitHub release GitHub-actions
  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.

You can also join us at our #managed-interop Gitter discussion channel.

Support

For building wrappers and priority support please write to [email protected]. Alternatively, you may post bounties at https://www.bountysource.com/.

Users

CppSharp is used by the following projects:

QtSharp

MonoGame

LLDBSharp

Xamarin

FFMPEG.net

FFmpeg bindings

Tizen bindings

libgd bindings

ChakraSharp

FFmpeg.AutoGen

GLFW3.NET

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

Comments
  • Archlinux builds

    Archlinux builds

    Continuing discussion from #946 so that i stop hijacking that bug report as issue is no longer relevant overthere.

    I am trying to build CppSharp on Archlinux. Few issues are already solved:

    diff --git a/build/Helpers.lua b/build/Helpers.lua                                                                                                                                                                   [0/10]
    index 846e4995..0530678d 100644
    --- a/build/Helpers.lua
    +++ b/build/Helpers.lua
    @@ -81,6 +81,7 @@ function SetupNativeProject()
    
       filter { "action:gmake" }
         buildoptions { gcc_buildflags }
    +    links { "z", "tinfo" }
    
       filter { "system:macosx", "language:C++" }
         buildoptions { gcc_buildflags, "-stdlib=libc++" }
    @@ -100,7 +101,7 @@ end
     function SetupManagedProject()
       language "C#"
       location ("%{wks.location}/projects")
    -
    +  buildoptions { "/platform:x64" }
       dotnetframework "4.6"
    
       if not os.istarget("macosx") then
    

    As you can see i had to:

    1. Link to z and tinfo in order to fix several missing imports.
    2. Force managed executables to build as 64bit. They defaulted to 32 bit executables and could not load 64bit native libraries produced by build system.

    Issue at hand

    mono --debug "../lib/Release_x64/CSharp.Gen.exe"
    
    Generating bindings for CSharp (CSharp)
    Looking for tests in: /home/rk/src/open/CppSharp/tests/CSharp
    mono: symbol lookup error: /home/rk/src/open/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so: undefined symbol: LLVMInitializeAArch64TargetInfo
    

    libCppSharp.CppParser.so fails to import LLVMInitializeAArch64TargetInfo symbol:

    ~/src/open/CppSharp/build/gmake/lib/Release_x64 % objdump -t libCppSharp.CppParser.so|grep LLVMInitializeAArch64TargetInfo
    0000000000000000         *UND*  0000000000000000              LLVMInitializeAArch64TargetInfo
    

    This symbol is defined in Target/AArch64/TargetInfo/AArch64TargetInfo.cpp:

    ~/src/open/CppSharp % grep -rF LLVMInitializeAArch64TargetInfo
    deps/llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp:extern "C" void LLVMInitializeAArch64TargetInfo() {
    deps/llvm/unittests/Target/AArch64/InstSizes.cpp:  LLVMInitializeAArch64TargetInfo();
    build/gmake/lib/Release_x64/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp:extern "C" void LLVMInitializeAArch64TargetInfo() {
    Binary file build/gmake/lib/Release_x64/libCppSharp.CppParser.so matches
    Binary file build/gmake/obj/Release_x64/x64/Release/CppSharp.CppParser/Parser.o matches
    

    Not sure how to proceed from here.. Any ideas?

  • CppSharp does not properly support new GCC5 ABI

    CppSharp does not properly support new GCC5 ABI

    Brief Description; "

    When build cppsharp under unbuntu, got the following message:

    Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

    OS: Windows / OS X / Linux (include version and/or distro) ubuntu 16.04

    Used headers
    Used settings

    Target: MSVC/GCC/Clang

    Other settings

    Stack trace or incompilable generated code

    Running prebuild commands mono --debug "../lib/Release_x64/Encodings.Gen.exe"

    Generating bindings for Encodings (CSharp) Looking for tests in: /home/user1/projects/csharp/CppSharp/tests/Encodings Stacktrace:

    at <0xffffffff> at (wrapper managed-to-native) CppSharp.Parser.ClangParser/__Internal.ParseHeader_0 (intptr) <IL 0x00009, 0x0005f> ....

  • Master build artifact missing

    Master build artifact missing

    Hi,

    Before the change to use Github actions, the appveyor builds had artifact outputs when master was built that we could take and integrate with our code (save us having to wait a long time for the NuGet release).

    I cannot seem to find any produced artifacts with the Github action builds when master is built?

    Thanks.

  • Invalid generated code for variable array global variable

    Invalid generated code for variable array global variable

    Brief Description

    I would like to generate bindings for Gammu, a C library that is freely available. when trying to do so it gives an error saying it does not find the gammu.lib file nor the headers. I suspect I am not putting them at the right place. where should I put the files so that cppsharp sees them ?

    OS: Windows here is a sample of my generator

    ` class MyGenerator : ILibrary {

        private const string GammuRootPath = @"C:\Program Files\Gammu 1.38.1";
        private const string GammuIncludePath = GammuRootPath + @"\include\";
        private const string GammuLibPath = GammuRootPath + @"\lib\";
    
    
        public void Postprocess(Driver driver, ASTContext ctx)
        {
            //throw new NotImplementedException();
        }
    
        public void Preprocess(Driver driver, ASTContext ctx)
        {
            //throw new NotImplementedException();
        }
    
        public void Setup(Driver driver)
        {
          
    
            PrepareDriver(driver);
    
        }
    
        private static void PrepareDriver(Driver driver)
        {
            var drOptions = driver.Options;
            drOptions.GeneratorKind = GeneratorKind.CSharp;
            //drOptions.CompileCode = true;
            drOptions.OutputDir = "GammuSharp";
            drOptions.LibraryName = "libGammuSharp";
          
            drOptions.Libraries.Add("Gammu.lib");
            
            drOptions.OutputInteropIncludes = true;
            drOptions.GenerateInternalImports = true;
            //drOptions.Target = CompilationTarget.StaticLibrary;
            drOptions.Platform = TargetPlatform.Windows;
            drOptions.VsVersion = VisualStudioVersion.VS2012;
            drOptions.UseHeaderDirectories = true;
            
            //drOptions.OutputNamespace = "GammuSharp";
            
            // header files to include
    
            //drOptions.Headers.Add(GammuIncludePath + "gammu.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-wap.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-unicode.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-types.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-statemachine.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-smsd.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-settings.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-security.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-ringtone.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-nokia.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-misc.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-message.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-memory.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-limits.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-keys.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-inifile.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-info.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-file.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-error.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-debug.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-datetime.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-config.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-category.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-callback.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-call.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-calendar.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-bitmap.h");
            //drOptions.Headers.Add(GammuIncludePath + "gammu-backup.h");
    
    
    
        }
    
        public void SetupPasses(Driver driver)
        {
            
        }
    }
    

    `

  • Linux: Tests generation does not take C++11 ABI mode into account

    Linux: Tests generation does not take C++11 ABI mode into account

    Brief Description

    I've built llvm from source on debian 9 (stretch), using mono from upstream, Compile.sh command crashes mono

    OS: Windows / OS X / Linux (include version and/or distro) Gnu/Debian Linux 9.3

    Stack trace or incompilable generated code
    make -C gmake config=release_x64
    make: Entering directory '/root/CppSharp/build/gmake'
    ==== Building CppSharp (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building CppSharp.AST (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building CppSharp.CppParser (release_x64) ====
    ==== Building Std-symbols (release_x64) ====
    ==== Building CppSharp.Runtime (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building CppSharp.Parser.CSharp (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building CppSharp.Parser (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building CppSharp.Generator (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building CppSharp.Parser.Gen (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building CppSharp.CLI (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building CppSharp.Generator.Tests (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building VTables.Native (release_x64) ====
    ==== Building VTables.Gen (release_x64) ====
    make[1]: Nothing to be done for 'all'.
    ==== Building VTables.CSharp (release_x64) ====
    Running prebuild commands
    mono --debug "../lib/Release_x64/VTables.Gen.exe"
    
    Generating bindings for VTables (CLI)
    Looking for tests in: /root/CppSharp/tests/VTables
    *** Error in `mono': free(): invalid pointer: 0x000055c686e4a870 ***
    ======= Backtrace: =========
    /lib/x86_64-linux-gnu/libc.so.6(+0x70bcb)[0x7f5c94e4fbcb]
    /lib/x86_64-linux-gnu/libc.so.6(+0x76f96)[0x7f5c94e55f96]
    /lib/x86_64-linux-gnu/libc.so.6(+0x777de)[0x7f5c94e567de]
    /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN8CppSharp9CppParser6Parser5SetupEv+0xaa1)[0x7f5c8990a301]
    /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN8CppSharp9CppParser6Parser11ParseHeaderERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EE+0x52)[0x7f5c89919ce2]
    [0x40350f1d]
    ======= Memory map: ========
    402fc000-40360000 rwxp 00000000 00:00 0 
    419ba000-419ca000 rwxp 00000000 00:00 0 
    55c684fe4000-55c6853cc000 r-xp 00000000 08:03 10617238                   /usr/bin/mono-sgen
    55c6855cc000-55c6855d2000 r--p 003e8000 08:03 10617238                   /usr/bin/mono-sgen
    55c6855d2000-55c6855d5000 rw-p 003ee000 08:03 10617238                   /usr/bin/mono-sgen
    55c6855d5000-55c68562b000 rw-p 00000000 00:00 0 
    55c6865fe000-55c686ed1000 rw-p 00000000 00:00 0                          [heap]
    7f5c84000000-7f5c84021000 rw-p 00000000 00:00 0 
    7f5c84021000-7f5c88000000 ---p 00000000 00:00 0 
    7f5c89271000-7f5c8bbdf000 r-xp 00000000 08:03 10705759                   /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
    7f5c8bbdf000-7f5c8bddf000 ---p 0296e000 08:03 10705759                   /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
    7f5c8bddf000-7f5c8bfbd000 r--p 0296e000 08:03 10705759                   /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
    7f5c8bfbd000-7f5c8bfe6000 rw-p 02b4c000 08:03 10705759                   /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
    7f5c8bfe6000-7f5c8c000000 rw-p 00000000 00:00 0 
    7f5c8c000000-7f5c8c021000 rw-p 00000000 00:00 0 
    7f5c8c021000-7f5c90000000 ---p 00000000 00:00 0 
    7f5c91430000-7f5c914b0000 rw-p 00000000 00:00 0 
    7f5c914b3000-7f5c917b4000 r--p 00000000 08:03 10617280                   /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
    7f5c917b4000-7f5c91800000 r--p 00000000 08:03 10617322                   /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
    7f5c91800000-7f5c91900000 rw-p 00000000 00:00 0 
    7f5c91919000-7f5c91937000 r--p 00000000 08:03 10617301                   /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    7f5c91937000-7f5c91938000 r-xp 00000000 08:03 10705860                   /root/CppSharp/build/gmake/lib/Release_x64/libStd-symbols.so
    7f5c91938000-7f5c91b37000 ---p 00001000 08:03 10705860                   /root/CppSharp/build/gmake/lib/Release_x64/libStd-symbols.so
    7f5c91b37000-7f5c91b38000 r--p 00000000 08:03 10705860                   /root/CppSharp/build/gmake/lib/Release_x64/libStd-symbols.so
    7f5c91b38000-7f5c91b39000 rw-p 00001000 08:03 10705860                   /root/CppSharp/build/gmake/lib/Release_x64/libStd-symbols.so
    7f5c91b39000-7f5c91cab000 r-xp 00000000 08:03 10643167                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
    7f5c91cab000-7f5c91eab000 ---p 00172000 08:03 10643167                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
    7f5c91eab000-7f5c91eb5000 r--p 00172000 08:03 10643167                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
    7f5c91eb5000-7f5c91eb7000 rw-p 0017c000 08:03 10643167                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
    7f5c91eb7000-7f5c91ebb000 rw-p 00000000 00:00 0 
    7f5c91ec1000-7f5c91ed9000 r--p 00000000 08:03 10705861                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Parser.CSharp.dll.mdb
    7f5c91ed9000-7f5c91f18000 r--p 00000000 08:03 10705859                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Parser.CSharp.dll
    7f5c91f18000-7f5c91f26000 r--p 00000000 08:03 10705863                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Parser.dll
    7f5c91f26000-7f5c921c5000 r--p 00000000 08:03 10617311                   /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
    7f5c921c5000-7f5c922bd000 r--p 00000000 08:03 10618913                   /usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
    7f5c922bd000-7f5c922c4000 r--p 00000000 08:03 10705737                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.dll
    7f5c922c4000-7f5c922ea000 r--p 00000000 08:03 10705740                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.AST.dll
    7f5c922ea000-7f5c922f3000 ---p 00000000 00:00 0 
    7f5c922f3000-7f5c924eb000 rw-p 00000000 00:00 0 
    7f5c924eb000-7f5c92a2a000 r-xp 00000000 08:03 10617257                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
    7f5c92a2a000-7f5c92c29000 ---p 0053f000 08:03 10617257                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
    7f5c92c29000-7f5c92c2a000 r--p 0053e000 08:03 10617257                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
    7f5c92c2a000-7f5c92c2b000 rw-p 0053f000 08:03 10617257                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
    7f5c92c2b000-7f5c92c48000 rw-p 00000000 00:00 0 
    7f5c92c48000-7f5c92fff000 r--p 00000000 08:03 10617268                   /usr/lib/mono/4.5/mscorlib.dll
    7f5c92fff000-7f5c93fff000 rw-p 00000000 00:00 0 
    7f5c93fff000-7f5c94000000 ---p 00000000 00:00 0 
    7f5c94000000-7f5c94c00000 rw-p 00000000 00:00 0 
    7f5c94c00000-7f5c94c04000 r--p 00000000 08:03 10705864                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Parser.dll.mdb
    7f5c94c04000-7f5c94c13000 r--p 00000000 08:03 10705741                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.AST.dll.mdb
    7f5c94c13000-7f5c94c40000 r--p 00000000 08:03 10705867                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Generator.dll.mdb
    7f5c94c40000-7f5c94ccb000 r--p 00000000 08:03 10705866                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Generator.dll
    7f5c94ccb000-7f5c94d80000 rw-p 00000000 00:00 0 
    7f5c94d80000-7f5c94ddf000 ---p 00000000 00:00 0 
    7f5c94ddf000-7f5c94f74000 r-xp 00000000 08:03 10638015                   /lib/x86_64-linux-gnu/libc-2.24.so
    7f5c94f74000-7f5c95174000 ---p 00195000 08:03 10638015                   /lib/x86_64-linux-gnu/libc-2.24.so
    7f5c95174000-7f5c95178000 r--p 00195000 08:03 10638015                   /lib/x86_64-linux-gnu/libc-2.24.so
    7f5c95178000-7f5c9517a000 rw-p 00199000 08:03 10638015                   /lib/x86_64-linux-gnu/libc-2.24.so
    7f5c9517a000-7f5c9517e000 rw-p 00000000 00:00 0 
    7f5c9517e000-7f5c95194000 r-xp 00000000 08:03 10637934                   /lib/x86_64-linux-gnu/libgcc_s.so.1
    7f5c95194000-7f5c95393000 ---p 00016000 08:03 10637934                   /lib/x86_64-linux-gnu/libgcc_s.so.1
    7f5c95393000-7f5c95394000 r--p 00015000 08:03 10637934                   /lib/x86_64-linux-gnu/libgcc_s.so.1
    7f5c95394000-7f5c95395000 rw-p 00016000 08:03 10637934                   /lib/x86_64-linux-gnu/libgcc_s.so.1
    7f5c95395000-7f5c953ad000 r-xp 00000000 08:03 10639845                   /lib/x86_64-linux-gnu/libpthread-2.24.so
    7f5c953ad000-7f5c955ac000 ---p 00018000 08:03 10639845                   /lib/x86_64-linux-gnu/libpthread-2.24.so
    7f5c955ac000-7f5c955ad000 r--p 00017000 08:03 10639845                   /lib/x86_64-linux-gnu/libpthread-2.24.so
    7f5c955ad000-7f5c955ae000 rw-p 00018000 08:03 10639845                   /lib/x86_64-linux-gnu/libpthread-2.24.so
    7f5c955ae000-7f5c955b2000 rw-p 00000000 00:00 0 
    7f5c955b2000-7f5c955b5000 r-xp 00000000 08:03 10638018                   /lib/x86_64-linux-gnu/libdl-2.24.so
    7f5c955b5000-7f5c957b4000 ---p 00003000 08:03 10638018                   /lib/x86_64-linux-gnu/libdl-2.24.so
    7f5c957b4000-7f5c957b5000 r--p 00002000 08:03 10638018                   /lib/x86_64-linux-gnu/libdl-2.24.so
    7f5c957b5000-7f5c957b6000 rw-p 00003000 08:03 10638018                   /lib/x86_64-linux-gnu/libdl-2.24.so
    7f5c957b6000-7f5c957bd000 r-xp 00000000 08:03 10639849                   /lib/x86_64-linux-gnu/librt-2.24.so
    7f5c957bd000-7f5c959bc000 ---p 00007000 08:03 10639849                   /lib/x86_64-linux-gnu/librt-2.24.so
    7f5c959bc000-7f5c959bd000 r--p 00006000 08:03 10639849                   /lib/x86_64-linux-gnu/librt-2.24.so
    7f5c959bd000-7f5c959be000 rw-p 00007000 08:03 10639849                   /lib/x86_64-linux-gnu/librt-2.24.so
    7f5c959be000-7f5c95ac1000 r-xp 00000000 08:03 10638019                   /lib/x86_64-linux-gnu/libm-2.24.so
    7f5c95ac1000-7f5c95cc0000 ---p 00103000 08:03 10638019                   /lib/x86_64-linux-gnu/libm-2.24.so
    7f5c95cc0000-7f5c95cc1000 r--p 00102000 08:03 10638019                   /lib/x86_64-linux-gnu/libm-2.24.so
    7f5c95cc1000-7f5c95cc2000 rw-p 00103000 08:03 10638019                   /lib/x86_64-linux-gnu/libm-2.24.so
    7f5c95cc2000-7f5c95ce5000 r-xp 00000000 08:03 10638011                   /lib/x86_64-linux-gnu/ld-2.24.so
    7f5c95ce5000-7f5c95ce6000 rw-p 00000000 00:00 0 
    7f5c95ce6000-7f5c95ce8000 r--p 00000000 08:03 10705738                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.dll.mdb
    7f5c95ce8000-7f5c95cec000 r--p 00000000 08:03 10705876                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Generator.Tests.dll.mdb
    7f5c95cec000-7f5c95cfa000 r--p 00000000 08:03 10705875                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Generator.Tests.dll
    7f5c95cfa000-7f5c95cfb000 r--p 00000000 08:03 10705881                   /root/CppSharp/build/gmake/lib/Release_x64/VTables.Gen.exe.mdb
    7f5c95cfb000-7f5c95d39000 rw-p 00000000 00:00 0 
    7f5c95d39000-7f5c95d3a000 r--p 00000000 08:03 10705880                   /root/CppSharp/build/gmake/lib/Release_x64/VTables.Gen.exe
    7f5c95d3a000-7f5c95d3c000 rw-p 00000000 00:00 0 
    7f5c95d3c000-7f5c95ed7000 r--p 00000000 08:03 10638384                   /usr/lib/locale/locale-archive
    7f5c95ed7000-7f5c95edd000 rw-p 00000000 00:00 0 
    7f5c95edd000-7f5c95ee1000 rw-p 00000000 00:00 0 
    7f5c95ee1000-7f5c95ee2000 rw-s 00000000 00:15 326096                     /dev/shm/mono.29999
    7f5c95ee2000-7f5c95ee5000 rw-p 00000000 00:00 0 
    7f5c95ee5000-7f5c95ee6000 r--p 00023000 08:03 10638011                   /lib/x86_64-linux-gnu/ld-2.24.so
    7f5c95ee6000-7f5c95ee7000 rw-p 00024000 08:03 10638011                   /lib/x86_64-linux-gnu/ld-2.24.so
    7f5c95ee7000-7f5c95ee8000 rw-p 00000000 00:00 0 
    7ffeb0f38000-7ffeb0f40000 ---p 00000000 00:00 0 
    7ffeb1716000-7ffeb1737000 rw-p 00000000 00:00 0                          [stack]
    7ffeb17d8000-7ffeb17db000 r--p 00000000 00:00 0                          [vvar]
    7ffeb17db000-7ffeb17dd000 r-xp 00000000 00:00 0                          [vdso]
    Stacktrace:
    
      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) CppSharp.Parser.ClangParser/__Internal.ParseHeader (intptr) [0x00009] in <95f4eb8eddbc458699c80105c122ab87>:0
      at CppSharp.Parser.ClangParser.ParseHeader (CppSharp.Parser.CppParserOptions) [0x0001f] in /root/CppSharp/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs:19240
      at CppSharp.ClangParser.ParseSourceFiles (System.Collections.Generic.IEnumerable`1<string>,CppSharp.Parser.ParserOptions) [0x00046] in /root/CppSharp/src/Parser/Parser.cs:56
      at CppSharp.ClangParser.ParseSourceFile (string,CppSharp.Parser.ParserOptions) [0x0000d] in /root/CppSharp/src/Parser/Parser.cs:43
      at CppSharp.Driver.ParseCode () [0x00130] in /root/CppSharp/src/Generator/Driver.cs:146
      at CppSharp.ConsoleDriver.Run (CppSharp.ILibrary) [0x00090] in /root/CppSharp/src/Generator/Driver.cs:425
      at CppSharp.Tests.VTableTests.Main (string[]) [0x00007] in /root/CppSharp/tests/VTables/VTables.cs:27
      at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <6ecb8b975cf54b76b8bf5e5192cb743e>:0
    /proc/self/maps:
    402fc000-40360000 rwxp 00000000 00:00 0 
    419ba000-419ca000 rwxp 00000000 00:00 0 
    55c684fe4000-55c6853cc000 r-xp 00000000 08:03 10617238                   /usr/bin/mono-sgen
    55c6855cc000-55c6855d2000 r--p 003e8000 08:03 10617238                   /usr/bin/mono-sgen
    55c6855d2000-55c6855d5000 rw-p 003ee000 08:03 10617238                   /usr/bin/mono-sgen
    55c6855d5000-55c68562b000 rw-p 00000000 00:00 0 
    55c6865fe000-55c686ed1000 rw-p 00000000 00:00 0                          [heap]
    7f5c84000000-7f5c84021000 rw-p 00000000 00:00 0 
    7f5c84021000-7f5c88000000 ---p 00000000 00:00 0 
    7f5c89271000-7f5c8bbdf000 r-xp 00000000 08:03 10705759                   /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
    7f5c8bbdf000-7f5c8bddf000 ---p 0296e000 08:03 10705759                   /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
    7f5c8bddf000-7f5c8bfbd000 r--p 0296e000 08:03 10705759                   /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
    7f5c8bfbd000-7f5c8bfe6000 rw-p 02b4c000 08:03 10705759                   /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so
    7f5c8bfe6000-7f5c8c000000 rw-p 00000000 00:00 0 
    7f5c8c000000-7f5c8c021000 rw-p 00000000 00:00 0 
    7f5c8c021000-7f5c90000000 ---p 00000000 00:00 0 
    7f5c91430000-7f5c914b0000 rw-p 00000000 00:00 0 
    7f5c914b3000-7f5c917b4000 r--p 00000000 08:03 10617280                   /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
    7f5c917b4000-7f5c91800000 r--p 00000000 08:03 10617322                   /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
    7f5c91800000-7f5c91900000 rw-p 00000000 00:00 0 
    7f5c91919000-7f5c91937000 r--p 00000000 08:03 10617301                   /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    7f5c91937000-7f5c91938000 r-xp 00000000 08:03 10705860                   /root/CppSharp/build/gmake/lib/Release_x64/libStd-symbols.so
    7f5c91938000-7f5c91b37000 ---p 00001000 08:03 10705860                   /root/CppSharp/build/gmake/lib/Release_x64/libStd-symbols.so
    7f5c91b37000-7f5c91b38000 r--p 00000000 08:03 10705860                   /root/CppSharp/build/gmake/lib/Release_x64/libStd-symbols.so
    7f5c91b38000-7f5c91b39000 rw-p 00001000 08:03 10705860                   /root/CppSharp/build/gmake/lib/Release_x64/libStd-symbols.so
    7f5c91b39000-7f5c91cab000 r-xp 00000000 08:03 10643167                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
    7f5c91cab000-7f5c91eab000 ---p 00172000 08:03 10643167                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
    7f5c91eab000-7f5c91eb5000 r--p 00172000 08:03 10643167                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
    7f5c91eb5000-7f5c91eb7000 rw-p 0017c000 08:03 10643167                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
    7f5c91eb7000-7f5c91ebb000 rw-p 00000000 00:00 0 
    7f5c91ec1000-7f5c91ed9000 r--p 00000000 08:03 10705861                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Parser.CSharp.dll.mdb
    7f5c91ed9000-7f5c91f18000 r--p 00000000 08:03 10705859                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Parser.CSharp.dll
    7f5c91f18000-7f5c91f26000 r--p 00000000 08:03 10705863                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Parser.dll
    7f5c91f26000-7f5c921c5000 r--p 00000000 08:03 10617311                   /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
    7f5c921c5000-7f5c922bd000 r--p 00000000 08:03 10618913                   /usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
    7f5c922bd000-7f5c922c4000 r--p 00000000 08:03 10705737                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.dll
    7f5c922c4000-7f5c922ea000 r--p 00000000 08:03 10705740                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.AST.dll
    7f5c922ea000-7f5c922f3000 ---p 00000000 00:00 0 
    7f5c922f3000-7f5c924eb000 rw-p 00000000 00:00 0 
    7f5c924eb000-7f5c92a2a000 r-xp 00000000 08:03 10617257                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
    7f5c92a2a000-7f5c92c29000 ---p 0053f000 08:03 10617257                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
    7f5c92c29000-7f5c92c2a000 r--p 0053e000 08:03 10617257                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
    7f5c92c2a000-7f5c92c2b000 rw-p 0053f000 08:03 10617257                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
    7f5c92c2b000-7f5c92c48000 rw-p 00000000 00:00 0 
    7f5c92c48000-7f5c92fff000 r--p 00000000 08:03 10617268                   /usr/lib/mono/4.5/mscorlib.dll
    7f5c92fff000-7f5c93fff000 rw-p 00000000 00:00 0 
    7f5c93fff000-7f5c94000000 ---p 00000000 00:00 0 
    7f5c94000000-7f5c94c00000 rw-p 00000000 00:00 0 
    7f5c94c00000-7f5c94c04000 r--p 00000000 08:03 10705864                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Parser.dll.mdb
    7f5c94c04000-7f5c94c13000 r--p 00000000 08:03 10705741                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.AST.dll.mdb
    7f5c94c13000-7f5c94c40000 r--p 00000000 08:03 10705867                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Generator.dll.mdb
    7f5c94c40000-7f5c94ccb000 r--p 00000000 08:03 10705866                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Generator.dll
    7f5c94ccb000-7f5c94d80000 rw-p 00000000 00:00 0 
    7f5c94d80000-7f5c94ddf000 ---p 00000000 00:00 0 
    7f5c94ddf000-7f5c94f74000 r-xp 00000000 08:03 10638015                   /lib/x86_64-linux-gnu/libc-2.24.so
    7f5c94f74000-7f5c95174000 ---p 00195000 08:03 10638015                   /lib/x86_64-linux-gnu/libc-2.24.so
    7f5c95174000-7f5c95178000 r--p 00195000 08:03 10638015                   /lib/x86_64-linux-gnu/libc-2.24.so
    7f5c95178000-7f5c9517a000 rw-p 00199000 08:03 10638015                   /lib/x86_64-linux-gnu/libc-2.24.so
    7f5c9517a000-7f5c9517e000 rw-p 00000000 00:00 0 
    7f5c9517e000-7f5c95194000 r-xp 00000000 08:03 10637934                   /lib/x86_64-linux-gnu/libgcc_s.so.1
    7f5c95194000-7f5c95393000 ---p 00016000 08:03 10637934                   /lib/x86_64-linux-gnu/libgcc_s.so.1
    7f5c95393000-7f5c95394000 r--p 00015000 08:03 10637934                   /lib/x86_64-linux-gnu/libgcc_s.so.1
    7f5c95394000-7f5c95395000 rw-p 00016000 08:03 10637934                   /lib/x86_64-linux-gnu/libgcc_s.so.1
    7f5c95395000-7f5c953ad000 r-xp 00000000 08:03 10639845                   /lib/x86_64-linux-gnu/libpthread-2.24.so
    7f5c953ad000-7f5c955ac000 ---p 00018000 08:03 10639845                   /lib/x86_64-linux-gnu/libpthread-2.24.so
    7f5c955ac000-7f5c955ad000 r--p 00017000 08:03 10639845                   /lib/x86_64-linux-gnu/libpthread-2.24.so
    7f5c955ad000-7f5c955ae000 rw-p 00018000 08:03 10639845                   /lib/x86_64-linux-gnu/libpthread-2.24.so
    7f5c955ae000-7f5c955b2000 rw-p 00000000 00:00 0 
    7f5c955b2000-7f5c955b5000 r-xp 00000000 08:03 10638018                   /lib/x86_64-linux-gnu/libdl-2.24.so
    7f5c955b5000-7f5c957b4000 ---p 00003000 08:03 10638018                   /lib/x86_64-linux-gnu/libdl-2.24.so
    7f5c957b4000-7f5c957b5000 r--p 00002000 08:03 10638018                   /lib/x86_64-linux-gnu/libdl-2.24.so
    7f5c957b5000-7f5c957b6000 rw-p 00003000 08:03 10638018                   /lib/x86_64-linux-gnu/libdl-2.24.so
    7f5c957b6000-7f5c957bd000 r-xp 00000000 08:03 10639849                   /lib/x86_64-linux-gnu/librt-2.24.so
    7f5c957bd000-7f5c959bc000 ---p 00007000 08:03 10639849                   /lib/x86_64-linux-gnu/librt-2.24.so
    7f5c959bc000-7f5c959bd000 r--p 00006000 08:03 10639849                   /lib/x86_64-linux-gnu/librt-2.24.so
    7f5c959bd000-7f5c959be000 rw-p 00007000 08:03 10639849                   /lib/x86_64-linux-gnu/librt-2.24.so
    7f5c959be000-7f5c95ac1000 r-xp 00000000 08:03 10638019                   /lib/x86_64-linux-gnu/libm-2.24.so
    7f5c95ac1000-7f5c95cc0000 ---p 00103000 08:03 10638019                   /lib/x86_64-linux-gnu/libm-2.24.so
    7f5c95cc0000-7f5c95cc1000 r--p 00102000 08:03 10638019                   /lib/x86_64-linux-gnu/libm-2.24.so
    7f5c95cc1000-7f5c95cc2000 rw-p 00103000 08:03 10638019                   /lib/x86_64-linux-gnu/libm-2.24.so
    7f5c95cc2000-7f5c95ce5000 r-xp 00000000 08:03 10638011                   /lib/x86_64-linux-gnu/ld-2.24.so
    7f5c95ce5000-7f5c95ce6000 rw-p 00000000 00:00 0 
    7f5c95ce6000-7f5c95ce8000 r--p 00000000 08:03 10705738                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.dll.mdb
    7f5c95ce8000-7f5c95cec000 r--p 00000000 08:03 10705876                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Generator.Tests.dll.mdb
    7f5c95cec000-7f5c95cfa000 r--p 00000000 08:03 10705875                   /root/CppSharp/build/gmake/lib/Release_x64/CppSharp.Generator.Tests.dll
    7f5c95cfa000-7f5c95cfb000 r--p 00000000 08:03 10705881                   /root/CppSharp/build/gmake/lib/Release_x64/VTables.Gen.exe.mdb
    7f5c95cfb000-7f5c95d39000 rw-p 00000000 00:00 0 
    7f5c95d39000-7f5c95d3a000 r--p 00000000 08:03 10705880                   /root/CppSharp/build/gmake/lib/Release_x64/VTables.Gen.exe
    7f5c95d3a000-7f5c95d3c000 rw-p 00000000 00:00 0 
    7f5c95d3c000-7f5c95ed7000 r--p 00000000 08:03 10638384                   /usr/lib/locale/locale-archive
    7f5c95ed7000-7f5c95edd000 rw-p 00000000 00:00 0 
    7f5c95edd000-7f5c95ee1000 rw-p 00000000 00:00 0 
    7f5c95ee1000-7f5c95ee2000 rw-s 00000000 00:15 326096                     /dev/shm/mono.29999
    7f5c95ee2000-7f5c95ee5000 rw-p 00000000 00:00 0 
    7f5c95ee5000-7f5c95ee6000 r--p 00023000 08:03 10638011                   /lib/x86_64-linux-gnu/ld-2.24.so
    7f5c95ee6000-7f5c95ee7000 rw-p 00024000 08:03 10638011                   /lib/x86_64-linux-gnu/ld-2.24.so
    7f5c95ee7000-7f5c95ee8000 rw-p 00000000 00:00 0 
    7ffeb0f38000-7ffeb0f40000 ---p 00000000 00:00 0 
    7ffeb1716000-7ffeb1737000 rw-p 00000000 00:00 0                          [stack]
    7ffeb17d8000-7ffeb17db000 r--p 00000000 00:00 0                          [vvar]
    7ffeb17db000-7ffeb17dd000 r-xp 00000000 00:00 0                          [vdso]
    
    Native stacktrace:
    
            mono(+0xc367c) [0x55c6850a767c]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x110c0) [0x7f5c953a60c0]
            /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcf) [0x7f5c94e11fcf]
            /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f5c94e133fa]
            /lib/x86_64-linux-gnu/libc.so.6(+0x70bd0) [0x7f5c94e4fbd0]
            /lib/x86_64-linux-gnu/libc.so.6(+0x76f96) [0x7f5c94e55f96]
            /lib/x86_64-linux-gnu/libc.so.6(+0x777de) [0x7f5c94e567de]
            /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN8CppSharp9CppParser6Parser5SetupEv+0xaa1) [0x7f5c8990a301]
            /root/CppSharp/build/gmake/lib/Release_x64/libCppSharp.CppParser.so(_ZN8CppSharp9CppParser6Parser11ParseHeaderERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EE+0x52) [0x7f5c89919ce2]
            [0x40350f1d]
    
    Debug info from gdb:
    
    [New LWP 30000]
    [New LWP 30001]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    0x00007f5c953a5b3a in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0
      Id   Target Id         Frame 
    * 1    Thread 0x7f5c95ed7740 (LWP 29999) "mono" 0x00007f5c953a5b3a in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0
      2    Thread 0x7f5c947ff700 (LWP 30000) "SGen worker" 0x00007f5c953a215f in [email protected]@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
      3    Thread 0x7f5c924ea700 (LWP 30001) "Finalizer" 0x00007f5c953a4536 in do_futex_wait.constprop () from /lib/x86_64-linux-gnu/libpthread.so.0
    
    Thread 3 (Thread 0x7f5c924ea700 (LWP 30001)):
    #0  0x00007f5c953a4536 in do_futex_wait.constprop () from /lib/x86_64-linux-gnu/libpthread.so.0
    #1  0x00007f5c953a45e4 in __new_sem_wait_slow.constprop.0 () from /lib/x86_64-linux-gnu/libpthread.so.0
    #2  0x000055c68522d5a2 in ?? ()
    #3  0x000055c6851ef85c in ?? ()
    #4  0x00007f5c9539c494 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
    #5  0x00007f5c94ec7aff in clone () from /lib/x86_64-linux-gnu/libc.so.6
    
    Thread 2 (Thread 0x7f5c947ff700 (LWP 30000)):
    #0  0x00007f5c953a215f in [email protected]@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
    #1  0x000055c68528b15b in ?? ()
    #2  0x00007f5c9539c494 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
    #3  0x00007f5c94ec7aff in clone () from /lib/x86_64-linux-gnu/libc.so.6
    
    Thread 1 (Thread 0x7f5c95ed7740 (LWP 29999)):
    #0  0x00007f5c953a5b3a in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0
    #1  0x000055c6850a7760 in ?? ()
    #2  <signal handler called>
    #3  0x00007f5c94e11fcf in raise () from /lib/x86_64-linux-gnu/libc.so.6
    #4  0x00007f5c94e133fa in abort () from /lib/x86_64-linux-gnu/libc.so.6
    #5  0x00007f5c94e4fbd0 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
    #6  0x00007f5c94e55f96 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
    #7  0x00007f5c94e567de in ?? () from /lib/x86_64-linux-gnu/libc.so.6
    #8  0x00007f5c8990a301 in __gnu_cxx::new_allocator<char>::deallocate (this=0x7ffeb1733450, __p=<optimized out>) at /usr/include/c++/6/ext/new_allocator.h:110
    #9  std::allocator_traits<std::allocator<char> >::deallocate (__a=..., __n=<optimized out>, __p=<optimized out>) at /usr/include/c++/6/bits/alloc_traits.h:462
    #10 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_destroy (__size=<optimized out>, this=0x7ffeb1733450) at /usr/include/c++/6/bits/basic_string.h:186
    #11 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose (this=0x7ffeb1733450) at /usr/include/c++/6/bits/basic_string.h:181
    #12 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string (this=0x7ffeb1733450, __in_chrg=<optimized out>) at /usr/include/c++/6/bits/basic_string.h:558
    #13 CppSharp::CppParser::Parser::Setup ([email protected]=0x55c686e74630) at ../../../src/CppParser/Parser.cpp:268
    #14 0x00007f5c89919ce2 in CppSharp::CppParser::Parser::ParseHeader (this=0x55c686e74630, SourceFiles=std::vector of length 1, capacity 1 = {...}) at ../../../src/CppParser/Parser.cpp:4058
    #15 0x0000000040350f1d in ?? ()
    #16 0x00007f5c9482cfd0 in ?? ()
    #17 0x00007f5c94813548 in ?? ()
    #18 0x00007f5c9482d2c0 in ?? ()
    #19 0x00007f5c9482e620 in ?? ()
    #20 0x000055c686e5d830 in ?? ()
    #21 0x000055c68661d3b0 in ?? ()
    #22 0x00000000403501b0 in ?? ()
    #23 0x00007ffeb1733dd0 in ?? ()
    #24 0x00007ffeb1733cf0 in ?? ()
    #25 0x00000000403507f4 in ?? ()
    #26 0x00007f5c94813548 in ?? ()
    #27 0x00007f5c9482d2c0 in ?? ()
    #28 0x00007f5c9482d618 in ?? ()
    #29 0x000055c686e5d830 in ?? ()
    #30 0x00007ffeb1733dd0 in ?? ()
    #31 0x000000004032bd90 in ?? ()
    #32 0x0000000000000001 in ?? ()
    #33 0x0000000000000000 in ?? ()
    
    =================================================================
    Got a SIGABRT while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries 
    used by your application.
    =================================================================
    
    Aborted
    VTables.CSharp.make:102: recipe for target 'prebuild' failed
    make[1]: *** [prebuild] Error 134
    Makefile:194: recipe for target 'VTables.CSharp' failed
    make: *** [VTables.CSharp] Error 2
    make: Leaving directory '/root/CppSharp/build/gmake'
    
  • Compile fails with latest LLVM (they switched to std::atomic)

    Compile fails with latest LLVM (they switched to std::atomic)

    It seems LLVM has switched from using their own atomics to using std::atomic.

    When I try to compile the parser now I get: 3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\atomic(9): fatal error C1189: #error : is not supported when compiling with /clr or /clr:pure.

    This seems like a pretty bad thing. I'm not sure if it's possible to work around it?

    I guess switching to the new parser would be an option, but I'm still not sure how that is supposed to work... from what I understand there is no way to bootstrap?

  • Added support for Virtual function handling and a test. TEST FAILING!!

    Added support for Virtual function handling and a test. TEST FAILING!!

    I am opening this for discussion. I have no experience with C# delegates so I maybe missing something very basic. @ddobrev @tritao Please review and help.

  • Error when parsing headers referenced includes.

    Error when parsing headers referenced includes.

    Just want to say, awesome project. Great concept, and it is unbelievable how easy you have made it for others.

    I do have a question though. When CppSharp parses the headers I specify, I get an error about the headers that are referenced within the .h file, saying they can not be found. Mainly when they are in this format: "includes/types.h"

    I am adding a folder for the includes as such:

    options.IncludeDirs.Add(@"C:\Users\Joe\Documents\Testapp\lib\includes");

    Then adding each header as such:

    options.Headers.Add("interface.h");

    Now I know I could bypass this, but I am wondering if their is a way to set ignore parameters on headers. So I could ignore certain strings? Unless there is another way of fixing this.

  • ArgumentNullException while parse void(*func2)(void(*bug)());

    ArgumentNullException while parse void(*func2)(void(*bug)());

    Brief Description

    Windows 10 1803 build 17134.472 ArgumentNullException at DelegatesPass.cs#L180

    Used headers
    struct buggy
    {
    	void(*func2)(void(*bug)());
    };
    void func2(void(*bug)());
    
    Used settings

    Master branch, x86 Target: MSVC ver 14.16.27023 WinSDK ver 10.0.17763.0

    ILibrary.Setup()
    {
                var options = driver.Options;
                driver.ParserOptions.SetupMSVC();
                options.GeneratorKind = GeneratorKind.CSharp;
                var module = options.AddModule("Buggy");
                module.IncludeDirs.Add("C:\\sdk2\\");
                module.Headers.Add("Header.h");
                options.OutputDir = "C:\\sdk2\\";
    }
    

    Other defaults

  • argumentnullexception in mscorlib.dll system.io.path.combine

    argumentnullexception in mscorlib.dll system.io.path.combine

    My project was running fine when compiled and ran under VS2013. The only thing that I believe has changed was installing VS 2015. Now regardless if I compile using vs2013 or vs2015, I always get a null exception in system.io.path.combine.

    Here is my call stack when the exception is thrown:

        mscorlib.dll!System.IO.Path.Combine(string path1, string path2) + 0x6a bytes    
        CppSharp.dll!CppSharp.MSVCToolchain.CollectUniversalCRuntimeIncludeDirs(string vsDir, CppSharp.ToolchainVersion windowsKitSdk, int windowsSdkMajorVer) Line 249 + 0x16 bytes    C#
        CppSharp.dll!CppSharp.MSVCToolchain.GetSystemIncludes(CppSharp.VisualStudioVersion vsVersion) Line 181 + 0x1f bytes C#
        CppSharp.dll!CppSharp.OptionsExtensions.SetupMSVC(CppSharp.Parser.ParserOptions options, CppSharp.VisualStudioVersion vsVersion) Line 539 + 0x8 bytes   C#
        CppSharp.Generator.dll!CppSharp.Driver.SetupIncludes() Line 96 + 0x18 bytes C#
        CppSharp.Generator.dll!CppSharp.Driver.Setup() Line 85 + 0x8 bytes  C#
        CppSharp.Generator.dll!CppSharp.ConsoleDriver.Run(CppSharp.ILibrary library) Line 458 + 0xa bytes   C#
    

    What has changed and how do I fix it?

  • std::vector type visit failure

    std::vector type visit failure

    Brief Description

    OS: Windows (using binaries grabbed from appveyor build artifacts)

    Probably expected but headers containing std::vector are all failing to parse/generate. Case of failing source and error log below. Failure still occurs if only the member definitions in the class are left (after commenting out the accessor functions).

    Used headers

    One particular file: http://hastebin.com/sapazoxota.cpp Alternative Link: https://gist.github.com/tritao/4a48519392375c332789c1901d70d703

    Notables, "typedef std::vector typeName;" and returning by reference/const-reference in all cases. NOCOPYDEF macro is not remarkable (used elsewhere) just a generic "prevent copy" define.

    Used settings

    Target: MSVC, C++11, generating C++/CLI

    var options = driver.Options;
    options.Quiet = false;
    options.LibraryName = LibraryName;
    options.SharedLibraryName = LibraryName + ".Native.dll";
    options.LanguageVersion = CppSharp.Parser.LanguageVersion.CPlusPlus11;
    options.GeneratorKind = cli ? CppSharp.Generators.GeneratorKind.CLI : CppSharp.Generators.GeneratorKind.CSharp;
    options.GenerateSingleCSharpFile = true;
    options.Headers.AddRange(Includes);
    options.Libraries.AddRange(Libraries);
    options.OutputDir = WriteDir;
    options.GenerateLibraryNamespace = false;
    options.DryRun = Dry;
    
    Stack trace or incompilable generated code
    Unhandled Exception: System.NotImplementedException: The method or operation is not implemented.
       at CppSharp.Generators.CLI.CLITypePrinter.VisitTemplateParameterSubstitutionType(TemplateParameterSubstitutionType param, TypeQualifiers quals) in c:\projects\cppsharp\src\Generator\Generators\CLI\
    CLITypePrinter.cs:line 288
       at CppSharp.AST.TemplateParameterSubstitutionType.Visit[T](ITypeVisitor`1 visitor, TypeQualifiers quals) in c:\projects\cppsharp\src\AST\Type.cs:line 756
       at CppSharp.Generators.CLI.CLITypePrinter.VisitPointerType(PointerType pointer, TypeQualifiers quals) in c:\projects\cppsharp\src\Generator\Generators\CLI\CLITypePrinter.cs:line 188
       at CppSharp.AST.PointerType.Visit[T](ITypeVisitor`1 visitor, TypeQualifiers quals) in c:\projects\cppsharp\src\AST\Type.cs:line 321
       at CppSharp.Generators.CLI.CLIGenerator.TypePrinterDelegate(Type type) in c:\projects\cppsharp\src\Generator\Generators\CLI\CLIGenerator.cs:line 50
       at CppSharp.AST.Type.ToString() in c:\projects\cppsharp\src\AST\Type.cs:line 31
       at CppSharp.AST.QualifiedType.ToString() in c:\projects\cppsharp\src\AST\Type.cs:line 75
       at CppSharp.Passes.DeclarationName.<UpdateName>b__1(Parameter p) in c:\projects\cppsharp\src\Generator\Passes\CheckDuplicatedNamesPass.cs:line 47
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
       at System.String.Join(String separator, IEnumerable`1 values)
       at CppSharp.Passes.DeclarationName.UpdateName(Function function) in c:\projects\cppsharp\src\Generator\Passes\CheckDuplicatedNamesPass.cs:line 55
       at CppSharp.Passes.DeclarationName.UpdateName(Declaration decl) in c:\projects\cppsharp\src\Generator\Passes\CheckDuplicatedNamesPass.cs:line 26
       at CppSharp.Passes.CheckDuplicatedNamesPass.CheckDuplicate(Declaration decl) in c:\projects\cppsharp\src\Generator\Passes\CheckDuplicatedNamesPass.cs:line 215
       at CppSharp.Passes.CheckDuplicatedNamesPass.VisitMethodDecl(Method decl) in c:\projects\cppsharp\src\Generator\Passes\CheckDuplicatedNamesPass.cs:line 146
       at CppSharp.Passes.CheckDuplicatedNamesPass.VisitClassDecl(Class class) in c:\projects\cppsharp\src\Generator\Passes\CheckDuplicatedNamesPass.cs:line 162
       at CppSharp.AST.Class.Visit[T](IDeclVisitor`1 visitor) in c:\projects\cppsharp\src\AST\Class.cs:line 279
       at CppSharp.AST.AstVisitor.VisitTemplateSpecializationType(TemplateSpecializationType template, TypeQualifiers quals) in c:\projects\cppsharp\src\AST\ASTVisitor.cs:line 186
       at CppSharp.AST.TemplateSpecializationType.Visit[T](ITypeVisitor`1 visitor, TypeQualifiers quals) in c:\projects\cppsharp\src\AST\Type.cs:line 658
       at CppSharp.AST.AstVisitor.VisitTypedefDecl(TypedefDecl typedef) in c:\projects\cppsharp\src\AST\ASTVisitor.cs:line 346
       at CppSharp.AST.TypedefDecl.Visit[T](IDeclVisitor`1 visitor) in c:\projects\cppsharp\src\AST\Declaration.cs:line 372
       at CppSharp.AST.AstVisitor.VisitDeclarationContext(DeclarationContext context) in c:\projects\cppsharp\src\AST\ASTVisitor.cs:line 429
       at CppSharp.AST.AstVisitor.VisitNamespace(Namespace namespace) in c:\projects\cppsharp\src\AST\ASTVisitor.cs:line 405
       at CppSharp.AST.Namespace.Visit[T](IDeclVisitor`1 visitor) in c:\projects\cppsharp\src\AST\Namespace.cs:line 457
       at CppSharp.AST.AstVisitor.VisitDeclarationContext(DeclarationContext context) in c:\projects\cppsharp\src\AST\ASTVisitor.cs:line 440
       at CppSharp.Passes.TranslationUnitPass.VisitTranslationUnit(TranslationUnit unit) in c:\projects\cppsharp\src\Generator\Passes\Pass.cs:line 42
       at CppSharp.Passes.TranslationUnitPass.VisitLibrary(ASTContext context) in c:\projects\cppsharp\src\Generator\Passes\Pass.cs:line 26
       at CppSharp.Driver.<ProcessCode>b__5(TranslationUnitPass pass) in c:\projects\cppsharp\src\Generator\Driver.cs:line 323
       at CppSharp.PassBuilder`1.RunPasses(Action`1 action) in c:\projects\cppsharp\src\Generator\Passes\PassBuilder.cs:line 48
       at CppSharp.Driver.ProcessCode() in c:\projects\cppsharp\src\Generator\Driver.cs:line 318
       at CppSharp.ConsoleDriver.Run(ILibrary library) in c:\projects\cppsharp\src\Generator\Driver.cs:line 508
       at SharpBind.Program.Main(String[] args) in c:\dev\SprueKit\SharpBind\Program.cs:line 204
    
  • Wrap pointer to array and array size to plain C# array

    Wrap pointer to array and array size to plain C# array

    Brief Description

    Is it possible to instruct CppSharp to wrap pair of (unsigned char* elements, size_t size) arguments as byte[] type in C#.

    Used headers

    void DoTheBestJobEver(unsigned char* elements, size_t size);

    Expected C# signature

    void DoTheBestJobEver(byte[] elements);

  • Can you ship the symbols with the packages?

    Can you ship the symbols with the packages?

    Brief Description

    Environment: Windows/Visual Studio 2022/Resharper 2022

    Currently, when using the packages and want to dig into sources, all you get is a reference assembly.

    Say, I want to peek into ctx.IgnoreFunctionWithName to see what it does, this is the result:

    public static void IgnoreFunctionWithName(this ASTContext context, string name);
    

    Unless I'm mistaken, if you'd ship the symbols with the packages, sources would show up from within VS, correct?

    Thank you!

  • cppsharp upgrade issue

    cppsharp upgrade issue

    Brief Description

    Upgrading cppsharp from 0.10.1 (32 bit) to latest version is throwing exceptions

    OS: Windows 10

    Recently taken over project from another team and identified that they have used cppsharp 32 bit version 0.10.1 which is quite older. It looked like they tried to upgrade it to version 0.10.5 but had the issue which they documented as:

    CppSharp, used by the InteropGenerator, has the following limitations and workarounds: It cannot reliably generate code to pass std::vector, and cannot pass std::list (see CppSharp - Standard library support). This must be handled in a partial class adding additional properties to the generated code, and properties returning the first element of the vector and its count are required. See the Fluid.Components property in CommonDomainModels.Adapter.Custom.Debug.cs for an example. Remember to duplicate this property in a Release copy of the partial class file. It does not support std::pair, but will still attempt to find related code in its Std.dll support library. To handle types defined based on std::pair, create a struct that derives from the same use of std::pair, which can then be parsed as normal. See the Contour.Coordinates property in CommonDomainModels.Adapter.Custom.Debug.cs for an example. Make sure std::string is passed as a reference - attempting to pass it directly will result in the generated setter calling a destructor which causes an access violation.

    I would need support to get it upgraded to latest version of cppsharp (32 bit) or whatever is preferred one.

  • I get

    I get "Heap has been corrupted" when I run the generated bindings of native C++ code built in Debug mode in .Net 6 project

    Brief Description

    OS: Windows 10 / .Net6 Target: MSVC/ Visual Studio 2022 / C++17/C11 / Native is Built in Debug Mode

    When generating CppSharp Bindings from a C++ project built in Debug Mode, and using the generating bindings and the native DLL in .Net 6, everything compiles successfully, but when running the .Net project and attempting to call some functions, I receive an unhandled exception: heap has been corrupted, and sometimes memory access violation. The problem doesn't appear when I compile the C++ native code in Release mode. Also, I'm using the default optimization and linker settings for the native project.

    I'm using the following Setup and Parsing Options:

    public void Setup(Driver driver)
            {
                var options = driver.Options;
                options.Compilation.Target = CompilationTarget.SharedLibrary;
                options.Quiet = _options.quietBuild;
                options.CheckSymbols = _options.checkSymbols;
                options.Compilation.DebugMode = _options.debugMode;
                options.Compilation.VsVersion = VisualStudioVersion.Latest;
                options.GenerateDebugOutput = _options.outputDebugInfo;
                options.GeneratorKind = GeneratorKind.CSharp;
                options.CompileCode = _options.compileOutputCode;
                options.GenerateFinalizers = true;
                options.GenerationOutputMode = _options.generationOutputMode;
                options.Verbose = _options.verbose;
                options.GenerateClassTemplates = _options.generateClassTemplates;
                options.Compilation.Platform = TargetPlatform.Windows;
                var module = options.AddModule(_managedLibName);
                module.IncludeDirs.Add(_includeDir);
                module.Headers.Add(header);
                module.LibraryDirs.Add(_libraryDirs);
                module.Libraries.Add(sharedLib);
                options.OutputDir = _localOutputDir;
    }
    
     public void SetupPasses(Driver driver)
      {
          driver.Options.MarshalCharAsManagedChar = true;
          driver.Context.TranslationUnitPasses.RenameDeclsUpperCase(RenameTargets.Any);
          driver.Context.TranslationUnitPasses.AddPass(new FunctionToInstanceMethodPass());
    }
    
      public void Preprocess(Driver driver, ASTContext ctx)
        {
        }
        public void Postprocess(Driver driver, ASTContext ctx)
        {
        }
    

    How to solve this problem?

    Cppsharp Unhandeld Exception

  • Use LibraryImportAttribute instead of DllImportAttribute

    Use LibraryImportAttribute instead of DllImportAttribute

    Brief Description

    When code generation is targeting .NET 7, LibraryImport should be used in place of DllImport as this will pre-generate marshalling operations normally performed at runtime.

    When framework target is lower than .NET 7, DllImport should continue to be used.

    More information about LibraryImportAttribute can be found here: https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-7/#libraryimport-p-invoke-source-generator

    (Non os specific, code generation)

    OS: N/A

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.

Pimoroni Pico Libraries and Examples Welcome to the brave new world of Pico! This repository contains the C/C++ and MicroPython libraries for our rang

Nov 24, 2022
Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:

sol2 sol2 is a C++ library binding to Lua. It currently supports all Lua versions 5.1+ (LuaJIT 2.0+ and MoonJIT included). sol2 aims to be easy to use

Nov 25, 2022
Structy is an irresponsibly dumb and simple struct serialization/deserialization library for C, Python, and vanilla JavaScript.

Structy Structy is an irresponsibly dumb and simple struct serialization/deserialization library for C, Python, and vanilla JavaScript. You can think

Sep 13, 2022
A tool for generating cross-language type declarations and interface bindings.

Djinni Djinni is a tool for generating cross-language type declarations and interface bindings. It's designed to connect C++ with either Java or Objec

Nov 19, 2022
Duktape - embeddable Javascript engine with a focus on portability and compact footprint

Duktape ⚠️ Master branch is undergoing incompatible changes for Duktape 3.x. To track Duktape 2.x, follow the v2-maintenance branch. Introduction Dukt

Nov 16, 2022
The missing bridge between Java and native C++

JavaCPP Commercial support: Introduction JavaCPP provides efficient access to native C++ inside Java, not unlike the way some C/C++ compilers interact

Nov 26, 2022
Seamless operability between C++11 and Python
Seamless operability between C++11 and Python

pybind11 — Seamless operability between C++11 and Python Setuptools example • Scikit-build example • CMake example Warning Combining older versions of

Nov 25, 2022
A minimalist and mundane scripting language.

Drift Script A minimalist and mundane scripting language. I like all simple things, simple and beautiful, simple and strong. I know that all developme

Nov 14, 2022
SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.

SWIG (Simplified Wrapper and Interface Generator) Version: 4.1.0 (in progress) Tagline: SWIG is a compiler that integrates C and C++ with languages

Nov 25, 2022
GLSL and ESSL are Khronos high-level shading languages.

GLSL GLSL and ESSL are Khronos high-level shading languages. Khronos Registries are available for OpenGL OpenGL ES Vulkan Extension specifications in

Nov 18, 2022
Notepad++ is a free source code editor and Notepad replacement that supports several programming languages and natural languages

Npp / Notepad++ is my customized text editor highly enhanced for coding such as insta-run, much more file extensions made self-recognizable, logically colored syntax highlighting for nearly every programming language and designed for very easy customizability -- from the toolbar, context menu, syntax coloring, plug-ins for optional increased capabilities and much more

Jan 23, 2022
High-level interface for low-level programming

Singeli Singeli is now able to compile useful programs to C, but it's very rough around the edges, with poor error reporting. We are beginning to use

Nov 12, 2022
The DirectX Shader Compiler project includes a compiler and related tools used to compile High-Level Shader Language (HLSL) programs into DirectX Intermediate Language (DXIL) representation

DirectX Shader Compiler The DirectX Shader Compiler project includes a compiler and related tools used to compile High-Level Shader Language (HLSL) pr

Nov 24, 2022
Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal

Low Level Graphics Library (LLGL) Documentation NOTE: This repository receives bug fixes only, but no major updates. Pull requests may still be accept

Nov 17, 2022
Hybrid Detect demonstrates CPU topology detection using multiple intrinsic and OS level APIs.

Hybrid Detect Hybrid Detect demonstrates CPU topology detection using multiple intrinsic and OS level APIs. First, we demonstrate usage of CPUID intri

Nov 12, 2022
Source Code for "Ray Tracing Gems: High-Quality and Real-Time Rendering with DXR and Other APIs" by Eric Haines and Tomas Akenine-Möller

Apress Source Code This repository accompanies Ray Tracing Gems: High-Quality and Real-Time Rendering with DXR and Other APIs by Eric Haines and Tomas

Nov 21, 2022
An AI for playing NES Tetris at a high level. Based primarily on search & heuristic, with high quality board evaluation through value iteration.

StackRabbit An AI that plays NES Tetris at a high level. Primarily based on search & heuristic, with high-quality board eval through value iteration.

Nov 20, 2022
POCO C++ Libraries are powerful cross-platform C++ libraries for building network
POCO C++ Libraries are powerful cross-platform C++ libraries for building network

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.

Nov 19, 2022
Legion Low Level Rendering Interface provides a graphics API agnostic rendering interface with minimal CPU overhead and low level access to verbose GPU operations.
Legion Low Level Rendering Interface provides a graphics API agnostic rendering interface with minimal CPU overhead and low level access to verbose GPU operations.

Legion-LLRI Legion-LLRI, or “Legion Low Level Rendering Interface” is a rendering API that aims to provide a graphics API agnostic approach to graphic

Aug 13, 2022
A water tank level sensor **Built With WisBlock** to detect overflow and low level conditions.
A water tank level sensor **Built With WisBlock** to detect overflow and low level conditions.

RAK12014 Laser TOF sensor coming soon WisBlock Watertank Level Sensor Watertank Overflow detection using the RAKwireless WisBlock modules. It implemen

Feb 3, 2022