“PointerWrapper”不包含接受 0 个参数的构造函数

'PointerWrapper' does not contain a constructor that takes 0 arguments

提问人:Scrub Tactics 提问时间:9/20/2023 更新时间:9/20/2023 访问量:7

问:

我正在尝试运行一个 Splashkit 项目,但这个错误不断弹出,不让我运行该文件并给我这个错误。有人知道如何解决这个问题吗?

这是我的程序.cs

using SplashKitSDK;

public class Program
{
    public static void Main()
    {
        new Window("Window Title... to change", 800, 600);

        SplashKit.Delay(5000);
    }
}

这是 SplashKit.cs 文件的一部分


    public Window(string caption, int width, int height) : base ( SplashKit.OpenWindow(caption, width, height), false )
    { }

        public Window(nint ptr) => this.ptr = ptr; //this is where the error is

        protected internal override void DoFree()
    {
        // System.Console.WriteLine("TODO: Free!");
        SplashKit.CloseWindow(this);
    }

[在此处输入图像描述](https://i.stack.imgur.com/VoCRs.png)

尝试了Visual Studio提供的修复程序,但没有解决问题。

C# .NET 调试 构造函数 编译器错误

评论

0赞 Community 9/21/2023
请修剪您的代码,以便更轻松地找到您的问题。请遵循这些准则,以创建最小的可重现示例

答: 暂无答案