C
C#2y ago
Yann BOYER

❔ Visual Studio thinks SDL2(using SDL2;) doesn't exists but package is installed(via NuGet).

Hello, I'm a C# beginner and I wanted to do a small project in C# with SDL2, I installed sdl2.nuget and sdl2_mixer.nuget packages but Visual Studio doesn't seems to recognize packages, in my code I import sdl2 vith "using SDL2;" and it warns me that SDL2 doesn't exists. I tried everything but nothing works, anyone knows how to fix this issue ?
16 Replies
Chiyoko_S
Chiyoko_S2y ago
How did you install the nuget package? also just to make sure NuGet also has C++ libraries hosted as well are you sure what you have is C# lib
Chiyoko_S
Chiyoko_S2y ago
https://www.nuget.org/packages/sdl2.nuget This surely does not look like one
sdl2.nuget 2.26.5
Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games. SDL officially support...
Chiyoko_S
Chiyoko_S2y ago
Quick search about SDK2 yields https://github.com/flibitijibibo/SDL2-CS which is a C# wrapper of the C library
GitHub
GitHub - flibitijibibo/SDL2-CS: SDL2# - C# Wrapper for SDL2
SDL2# - C# Wrapper for SDL2. Contribute to flibitijibibo/SDL2-CS development by creating an account on GitHub.
Yann BOYER
Yann BOYEROP2y ago
In nuget website it says "a project that depends on sdl2.nuget : cspspemu"(a psp emulator in C#), so this is why I thought it was a C# wrapper of SDL2. 🤔
Chiyoko_S
Chiyoko_S2y ago
well it could have a C++ library that's part of the grinowo
Yann BOYER
Yann BOYEROP2y ago
https://github.com/cspspemu/cspspemu/blob/master/CSPspEmu.Frontend.SDL/Program.cs This code, written in C# use this lib(found in the .csproj). This is a little bit weird. 🤔
GitHub
cspspemu/Program.cs at master · cspspemu/cspspemu
C# PSP Emulator (.NET Core 3.1). Contribute to cspspemu/cspspemu development by creating an account on GitHub.
Chiyoko_S
Chiyoko_S2y ago
interesting though it does have SDL2.dll in the source control which might be the lib dll?
Yann BOYER
Yann BOYEROP2y ago
Yes, so, what I can do for my problem ? :/
Chiyoko_S
Chiyoko_S2y ago
The official site does seem to suggest SDL2# as a recommended C# binding
Chiyoko_S
Chiyoko_S2y ago
GitHub
GitHub - flibitijibibo/SDL2-CS: SDL2# - C# Wrapper for SDL2
SDL2# - C# Wrapper for SDL2. Contribute to flibitijibibo/SDL2-CS development by creating an account on GitHub.
Yann BOYER
Yann BOYEROP2y ago
Yes, I could use this instead, but.. it seems that the project is no longer maintained(latest commit in the github page is January 2023 and it doesn't wrap the latest version of sdl2).
Chiyoko_S
Chiyoko_S2y ago
hmmmmmmmmmmm could look into P/Invoking to the C lib manually
Yann BOYER
Yann BOYEROP2y ago
Yes, or maybe I can use a alternative lib, what do you recommend for a lib that can draw shapes(pixels as rectangle/square) on a gui(which is multi-platform) ? I want to make a Chip8 Emulator in C# to improve my skills in C#.
Chiyoko_S
Chiyoko_S2y ago
Try asking around in #game-dev? looks kinda fitting
Yann BOYER
Yann BOYEROP2y ago
Okay, thanks !
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server