Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoLoud fails to detect SDL2 dll when using with VCPKG's SDL2 in debug build #353

Open
wutipong opened this issue Jan 22, 2023 · 0 comments

Comments

@wutipong
Copy link

Expected behavior:

It should detect the SDL2 dll properly.

Actual behavior:

It can't find the SDL2's dll and no sounds is produced. Also a crash when calling stop. This does not affect the release build.

The problem is, VCPKG changes the dll file name to SDL2d.dll when building a Debug project. SoLoud's dll detection code use the file name 'SDL2.dll' to get the dll handle. Since there's no such file it returns in error.

soloud_sdl2_dll.c :

static HMODULE sdl2_openDll()
{
	HMODULE res = LoadLibraryA("SDL2.dll");
        return res;
}

A possible fix would be to try loading the SDL2d.dll when LoadLibraryA() fails.

Steps to reproduce the problem:

  • Create a project which use SoLoud and SDL2. The SDL2 here would be VCPKG-based.
  • Make a Debug build.
  • Run the project

Here's my test project to reproduce the issue. You can clone the project and open the folder in Visual Studio
https://github.com/wutipong/soloud-sdl

SoLoud version, operating system, backend used, any other potentially useful information:

SoLoud Git latest.
Windows 11.
Visual Studio 2022 (17.4.4)
SDL2 from VCPKG (usually latest version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant