Justin-Credible / xbox-uwp-sdl2-starter

🎮 A starter project for building an Xbox UWP app using C# and SDL2 in Visual Studio.
https://www.justin-credible.net/2020/12/04/xbox-uwp-sdl2-starter-project/
MIT License
30 stars 7 forks source link

Strange problems when I change the target to ARM #1

Closed mediaexplorer74 closed 1 year ago

mediaexplorer74 commented 2 years ago

Hello, Justin!

I forked your cool sample.

My goal is to use SDL with UWP app for my sweet good oldie (WinPhone Lumia 950 with Win10Mobile) =)) I download SDL2 sources, re-compiled SDL.dll for ARM (os target - 15063). Then I put SDL2.dll on xbox-uwp-sdl2-starter/xbox-uwp-sdl2-starter folder. Then I choosed ARM, downgraded os target to 15063, then sucessfully recompiled your sample. After deploying on winphone at the moment of app initialization, I catch strange exception: System.DllNotFoundException: 'Unable to load DLL 'SDL2': The specified module could not be found. (Exception from HRESULT: 0x8007007E)' Position: SDL2.cs Function: INTERNAL_SDL_SetHint( Utf8Encode(name, utf8Name, utf8NameBufSize), Utf8Encode(value, utf8Value, utf8ValueBufSize) ); (called in SDL_SetHint) Maybe, ARM target have some special dll calling convention ? (confused)
Please help me if you can... =)

Justin-Credible commented 2 years ago

Sorry, I do not have any Windows 10 ARM devices to test with. The error message seems to indicate the DLL perhaps didn't make it to the device during deploy, but the steps you listed sound correct. Revisiting my instructions, I would check the following (though it sounds like you've already done this):

You could also add some debugging code before SDL2 init to list the files and see if the DLL made it to the device.

Hope this helps, good luck!

mediaexplorer74 commented 2 years ago

Sorry, I do not have any Windows 10 ARM devices to test with. The error message seems to indicate the DLL perhaps didn't make it to the device during deploy, but the steps you listed sound correct. Revisiting my instructions, I would check the following (though it sounds like you've already done this):

  • Obtain SLD2 sources and open VisualC-WinRT/UWP_VS2015/SDL-UWP.sln
  • Change build target from x64 Release to an ARM release target
  • Build and grab the SDL2.dll file
  • Copy DLL to starter project: src/xbox-uwp-sdl2-starter/SDL2.dll
  • In VS solution explorer, right click DLL and choose properties; ensure Build Action is set to Content and Copy to output directory is set to Always
  • Attempt to build and deploy the starter project again

You could also add some debugging code before SDL2 init to list the files and see if the DLL made it to the device.

Hope this helps, good luck!

Thank you for your answer. Oh, I forgot the fact that XBOX is not in ARM device family. Is it x64 family? Pardon :) Ok, I will try (again) to manually rebuild (recompile) the SDL2 src dode to an ARM release target and to "incorporate" into x-uwp-sdl2-startersolution as you explained to me.

Best, [m][e]