veldrid: Veldrid.StartupUtilities / Sdl2 do not add sdl2 binary

Hi,

I just trying your tutorials with vs code on mac. My .csproject file after part1 of your tutorial looks like this ... <ItemGroup> <PackageReference Include="Veldrid" Version="4.0.0" /> <PackageReference Include="Veldrid.StartupUtilities" Version="4.0.0" /> </ItemGroup> ...

However, running dotnet restore does not include the binary. Headerfiles are loaded, because autocompletion works. But the program will crash at runtime. Sdl2Window window = VeldridStartup.CreateWindow(ref windowCI); // crash

I dont know if nuget should resolve binary dependencies, but from the tutorial it seems like it should just work with these commands.

Thanks you for this API.

Best, Marc

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

Interesting, how does it work exactly? Any binary file in the package get copied? Or do you mark to be copied in the nuspec or something?

It’s convention-based. You put the binaries under a specific folder structure that determines which “runtimes” the binary applies to. runtimes/win-x64/native is the folder for native binaries that apply to 64-bit Windows. runtimes/linux-x64/native is the folder for 64-bit Linux binaries. And so on.

It turns out this was actually a bug in my NativeLibraryLoader project. It wasn’t able to locate libsdl2.dylib in the nuget package if you’re running on macOS 10.13 (High Sierra). The new 1.0.5 version of that package should fix this issue. If you manually add this to your project, it will upgrade that package and everything should work:

<PackageReference Include="NativeLibraryLoader" Version="1.0.5" />

The next patch for Veldrid will also update the dependency to 1.0.5.

Just to be sure: you are running on macOS 10.13, correct?