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

Cannot build SDL3.dll on Visual Studio with SDL_LIBC=OFF #9858

Closed
madebr opened this issue May 23, 2024 · 5 comments
Closed

Cannot build SDL3.dll on Visual Studio with SDL_LIBC=OFF #9858

madebr opened this issue May 23, 2024 · 5 comments
Assignees
Milestone

Comments

@madebr
Copy link
Contributor

madebr commented May 23, 2024

Since #9843, when configuring SDL with -DSDL_LIBC=OFF, linking SDL3.dll fails due to missing _beginthreadex and _endthreadex symbols.

Full error log:

SDL_timer.c.obj : error LNK2019: unresolved external symbol _beginthreadex referenced in function SDL_InitTimers
SDL_hidapi_rumble.c.obj : error LNK2001: unresolved external symbol _beginthreadex
SDL_windowsdialog.c.obj : error LNK2001: unresolved external symbol _beginthreadex
SDL_audio.c.obj : error LNK2001: unresolved external symbol _beginthreadex
SDL_camera.c.obj : error LNK2001: unresolved external symbol _beginthreadex
SDL_hidapi.c.obj : error LNK2001: unresolved external symbol _beginthreadex
SDL_thread.c.obj : error LNK2001: unresolved external symbol _beginthreadex
SDL_timer.c.obj : error LNK2001: unresolved external symbol _endthreadex
SDL_hidapi_rumble.c.obj : error LNK2001: unresolved external symbol _endthreadex
SDL_windowsdialog.c.obj : error LNK2001: unresolved external symbol _endthreadex
SDL_audio.c.obj : error LNK2001: unresolved external symbol _endthreadex
SDL_camera.c.obj : error LNK2001: unresolved external symbol _endthreadex
SDL_hidapi.c.obj : error LNK2001: unresolved external symbol _endthreadex
SDL_thread.c.obj : error LNK2001: unresolved external symbol _endthreadex
SDL3.dll : fatal error LNK1120: 2 unresolved externals
@icculus icculus self-assigned this May 23, 2024
@icculus icculus added this to the 3.2.0 milestone May 23, 2024
@icculus
Copy link
Collaborator

icculus commented May 23, 2024

So this is literally the calls to SDL_CreateThread inside of SDL.

I'm thinking the cleanest thing here is to add something in SDL_internal.h that, if !defined(HAVE_LIBC) will define SDL_BeginThreadFunction to NULL somewhere before including SDL.h.

That way it'll do the right thing for LIBC and non-LIBC builds of SDL, and it's all handled in one place.

@icculus
Copy link
Collaborator

icculus commented May 23, 2024

/__w/SDL/SDL/test/../src/SDL_internal.h:270:48: error: missing terminating ' character [-Werror]
270 | // gets included, so SDL_CreateThread calls won't try to reference the

...the Vita compiler doesn't like // comments...?

@icculus
Copy link
Collaborator

icculus commented May 23, 2024

okay, what the heck

@icculus
Copy link
Collaborator

icculus commented May 23, 2024

I believe this is resolved now. Let me know if it isn't!

@madebr
Copy link
Contributor Author

madebr commented May 23, 2024

It is resolved! Thank you!

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

2 participants