-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Failure to install libsdl3 with clang/libc++ #6320
Comments
Could you post the verbose/diagnosis installation logs? (-vD) |
Here you go. |
I noticed that you are using the clang toolchain on Windows as well as the libc++ runtime, there should be some errors here. When the host is Windows, the clang toolchain for the Windows platform is clang-cl and the runtime should be along the Windows platform runtime: MD, MDd, MT, MTd. Referring to your logs, I think you are using clang-cl. so you should change it to:
Or write xmake.lua like this (Not specifying the compiler and runtime in the project) and configure the project like this:
|
No, there shouldn't be any errors, building and using |
Also just because vcpkg uses libc++, and the c++_static runtime inside doesn't mean it should be done in xmake, it's just a way of naming it, call it whatever you want if you can. But there are rules in xmake, and according to the instructions here, c++_shared refers exclusively to the clang backend runtime on xmake.
|
I've tried to compile libsdl3 with clang-cl and llvm-mingw. They're all working fine.
Normally, only the fmt library gives an error because cmake can't find ninja, but libsdl3 compiles successfully. |
I observed this path in your error log: C:\\Program Files\LLVM\\include\c++\v1 Tips: It's much easier to use the visual studio installation of clang-cl, but it's only version 19.1.1. |
You do not need clang-cl to compile on Windows with clang, clang + libc++ should generally work. However, xmake-repo only supports msvc and clang-cl on Windows for packages build with cmake. |
I did some investigating, and I was able to build and run above project by adding the following: add_sysincludedirs "<path to installed libsdl3 package>\\include"
add_linkdirs "<path to installed libsdl3 package>\\lib"
add_syslinks("user32", "gdi32", "winmm", "imm32", "ole32", "oleaut32",
"version", "uuid", "advapi32", "setupapi", "shell32")
add_links "SDL3-static" This uses a libsdl3 package that was installed for a different project that was using "MT" runtime. I don't know, if this helps. |
I've also attempted to use shared config of libsdl3 and I've got a different problem: when invoking a linker, one of command line arguments isn't enclosed in quotes, which causes it to break in 2 parts. What the argument should be: -L"C:\\Program Files\\LLVM\\lib" Here is the one from the invocation: -LC:\\Program Files\\LLVM\\lib As you can see, it gets broken into The whole invocation: C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --msvc-ver=1943 --intdir=CMakeFiles\SDL3-shared.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1443~1.348\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\SDL3-shared.rsp /out:SDL3.dll /implib:SDL3.lib /pdb:pdb\SDL3.pdb /dll /version:0.0 /machine:x64 /machine:x64 /INCREMENTAL:NO -stdlib=libc++ -LC:\\Program Files\\LLVM\\lib && cd ." |
It looks like, I've found a workaround for this issue, until it's fixed: |
Xmake Version
2.9.8+HEAD.13fc39238
Operating System Version and Architecture
Windows 10 2022H2 x64
Describe Bug
Unable to install
libsdl3
when usinglibc++
runtime library. Gonna have to usevcpkg::sdl3
in the mean time, since it works.Expected Behavior
libsdl3
should install successfully.Project Configuration
Here is my
xmake.lua
:Here's my
main.c++
:Additional Information and Error Logs
Here's the output of
xmake
:The text was updated successfully, but these errors were encountered: