-
Notifications
You must be signed in to change notification settings - Fork 275
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
Build fails on Windows when unicode is enabled due to incompatible entry point name with SDL2 #1472
Comments
Thanks for the report! Well, I am truly shocked. Hijacking a program's I quickly looked through the SDL code. It seems that this part has undergone a few changes between SDL2 and SDL3. I will try to reproduce your finding, then I'll see if defining |
Thanks for looking into this. I was surprised by the "main" replacement business as well. I assume the previous version of fluidsynth worked with SDL2 because it didn't use "UNICODE" (and I am using UCRT so I assume I don't need UNICODE, so I am happy disabling that in my builds). |
SDL3 was just released yesterday, which no longer automatically includes |
Fixed by adding support for SDL3, which will be part of upcoming 2.4.4. |
Great, thanks. |
Building fluidsynth (version 2.4.2) for Windows fails when trying to link fluidsynth.exe, SDL_main is not found (SDL2 version 2.30.11), when unicode support (UNICODE) is enabled, which is the default. I am not sure whether it is a bug of fluidsynth or sdl2, but the technical cause is as follows.
SDL_main is supposed to be the entry point in the application, so in fluidsynth.exe, but it is not. The problem is that SDL2 expects that the application would define its entry point as "main" even when building with unicode enabled (and SDL2 renames it to "SDL_main"). See the SDL.h file:
However, fluidsynth defines the entry point as "wmain", so it won't be renamed to SDL_main, and the symbol wouldn't be found. It is indeed not just the name of the entry point, but also the arguments - SDL2 expects that the entry point would accept narrow characters. One can build fluidsynth fine when "unicode" is disabled per cmake option "-Denable-unicode=OFF".
The text was updated successfully, but these errors were encountered: