简体   繁体   English

在Visual Studio C#中引用SDL2

[英]Referencing SDL2 in a Visual Studio C#

The graphics library Veldrid throws: 图形库Veldrid抛出:

Could not find or load the native library from any name: [ SDL2.dll ]

when I try to run the example from the tutorial in a new C# Console Application, .NET v4.7.1. 当我尝试在新的C#控制台应用程序.NET v4.7.1中从教程中运行示例时。

When I try to reference the SDL2 dll , Visual Studio simply shows "A reference to 'C:\\...\\SDL2.dll' could not be added" 当我尝试引用SDL2 dll时 ,Visual Studio只是显示“无法添加对'C:\\ ... \\ SDL2.dll'的引用”

Do I need any additional wrappers? 我需要其他包装吗? Veldrid.StartupUtilities is already supposed to be a simple wrapper for SDL2. Veldrid.StartupUtilities已经被认为是SDL2的简单包装。

Do I need to use a different .NET version? 我需要使用其他.NET版本吗?

我右键单击我的项目,选择“ Add > Existing Item ,选择随Veldrid下载提供的SDL2.dll,单击“ Add > As Link ,如果较新且一切正常,将其Property OnBuild设置为Copy。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM