mono / CppSharp

Tools and libraries to glue C/C++ APIs to high-level languages
MIT License
3.13k stars 516 forks source link

CppSharp NuGet: Could not load file or assembly 'CppSharp.Generator #1857

Open angelotadres opened 3 months ago

angelotadres commented 3 months ago
Brief Description

Using CppSharp via NuGet (version 1.1.5.3168), the following error appears when running the Console Application: Could not load file or assembly 'CppSharp.Generator, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

OS: OS X Sonoma 14.5

Code Used

using CppSharp;
using CppSharp.AST;
using CppSharp.Generators;

namespace SkTools.BindingsGenerator;

internal class Program : ILibrary
{
    public static void Main(string[] args)
    {
        ConsoleDriver.Run(new Program());
    }

    public void Setup(Driver driver)
    {

        var options = driver.Options;
        options.GeneratorKind = GeneratorKind.CSharp;
        var module = options.AddModule("Sk.Native");
        module.IncludeDirs.Add("../../src/Sk.Native/include");
        module.Headers.Add("greeter.h");
        module.LibraryDirs.Add("../../src/Sk.Native/build");
        module.Libraries.Add("Sk.Native.dylib");

    }

    public void SetupPasses(Driver driver) { }

    public void Preprocess(Driver driver, ASTContext ctx) { }

    public void Postprocess(Driver driver, ASTContext ctx) { }
}

Target: GCC

Stack trace or incompilable generated code

There is no Stack trace; Project compiles, this is the error verbatim when running:

/Users/atadres/Stuff/Workspace/sk/tools/SkTools.BindingsGenerator/bin/Debug/net8.0/SkTools.BindingsGenerator
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'CppSharp.Generator, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

File name: 'CppSharp.Generator, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'

Process finished with exit code 134.
tritao commented 3 weeks ago

Is this on ARM64?

angelotadres commented 3 weeks ago

Yes. This was while using a Macbook M3.

tritao commented 3 weeks ago

OK, then it's expected, ARM64 is currently a WIP: https://github.com/mono/CppSharp/pull/1879 Still some issues to solve, hopefully it will be supported soon.