Referencing SDL2 in a Visual Studio C#

非 Y 不嫁゛ 提交于 2020-05-31 03:02:38

问题


The graphics library Veldrid throws:

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.

When I try to reference the SDL2 dll, Visual Studio simply shows "A reference to 'C:\...\SDL2.dll' could not be added"

Do I need any additional wrappers? Veldrid.StartupUtilities is already supposed to be a simple wrapper for SDL2.

Do I need to use a different .NET version?


回答1:


I right-clicked my project, selected Add > Existing Item, selected the SDL2.dll supplied with the Veldrid download, clicked Add > As Link, set its Property OnBuild to Copy if newer and everything worked.



来源:https://stackoverflow.com/questions/49212298/referencing-sdl2-in-a-visual-studio-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!