Skip to content

CppSharp.Runtime.UTF8Marshaller Included in generated source #1833

Open
@parksj10

Description

@parksj10

Brief Description

I'm trying to following the only example I could find here and I'm getting generated output. However, the generated source is depending on CppSharp the Std.cs file

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

Linux, Ubuntu 22.04

Used headers

#include <array>
#include <filesystem>
#include <memory>
#include <tuple>

Used settings

options.GeneratorKind = GeneratorKind.CSharp;
parserOptions.AddArguments("-fcxx-exceptions");
options.OutputDir = Path.Combine(Directory.GetCurrentDirectory(), "src", "Interop", "XXXX");

Compiler

Target: gcc

Language

C++11

Stack trace or incompilable generated code

error CS0246: The type or namespace name 'CppSharp' could not be found (are you missing a using directive or an assembly reference?)

from generated code:

    public unsafe static partial class BasicStringExtensions
    {
        public partial struct __Internal
        {

            [SuppressUnmanagedCodeSecurity, DllImport("Std-symbols", EntryPoint = "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKc", CallingConvention = __CallingConvention.Cdecl)]
            internal static extern __IntPtr Assign(__IntPtr __instance, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CppSharp.Runtime.UTF8Marshaller))] string __s);

        }

################################################################################

Not seeing why any reference to CppSharp should be included in codegen output, but I'm guessing it's some dumb error I'm making. Any help much appreciated!!!! Also, if you know of a solid example repo I can adapt, I'd be more than happy to try and reproduce off of that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions