CppSharp.Runtime.UTF8Marshaller Included in generated source
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with docs/GeneratingBindings.md and the generated Std.cs output described in the report. Trace why UTF8Marshaller is emitted and compare the generated source's runtime dependencies with the documented example; done means the reported generated code has a clear, compilable dependency path without an unresolved CppSharp reference.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C#
- Stars
- 3.4k
- Forks
- 541
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mono/CppSharp
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
How to get started Open
Difficulty 3/5 1-2 days Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100