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

Failure to install libsdl3 with clang/libc++ #6320

Open
RoqueDeicide opened this issue Feb 9, 2025 · 2 comments
Open

Failure to install libsdl3 with clang/libc++ #6320

RoqueDeicide opened this issue Feb 9, 2025 · 2 comments
Labels

Comments

@RoqueDeicide
Copy link

Xmake Version

2.9.8+HEAD.13fc39238

Operating System Version and Architecture

Windows 10 2022H2 x64

Describe Bug

Unable to install libsdl3 when using libc++ runtime library. Gonna have to use vcpkg::sdl3 in the mean time, since it works.

Expected Behavior

libsdl3 should install successfully.

Project Configuration

Here is my xmake.lua:

set_toolchains "clang"
set_runtimes "c++_static"		-- c++_shared has the same effect.
set_languages "c++latest"
add_requires "libsdl3"

target "libsdl3_issue"
    add_files "*.c++"
    add_packages "libsdl3"

    set_policy("build.c++.modules", true)

Here's my main.c++:

#include <SDL3/SDL.h>
	
import std;

int main (int, char *[])
{
    if (SDL_Init(SDL_INIT_EVENTS))
    {
        std::cout << "Hello SDL!\n";
        SDL_Quit();
    }
    return 0;
}

Additional Information and Error Logs

Here's the output of xmake:

checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.42.34436
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> libsdl3 3.2.2 [runtimes:"c++_static", toolchains:"clang", license:zlib]
please input: y (y/n/m)
y
  => install libsdl3 3.2.2 .. failed

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
clang++: error: linker command failed with exit code 1120 (use -v to see invocation)
t.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_asprintf_REAL'
LINK : warning LNK4217: symbol 'atoi' defined in 'libucrt.lib(atox.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_atoi_REAL'
LINK : warning LNK4217: symbol '_ltoa' defined in 'libucrt.lib(xtoa.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_ltoa_REAL'
LINK : warning LNK4217: symbol '_ultoa' defined in 'libucrt.lib(xtoa.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_uitoa_REAL'
LINK : warning LNK4217: symbol '_i64toa' defined in 'libucrt.lib(xtoa.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_lltoa_REAL'
LINK : warning LNK4217: symbol '_ui64toa' defined in 'libucrt.lib(xtoa.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_ulltoa_REAL'
LINK : warning LNK4217: symbol 'wcsnlen' defined in 'libucrt.lib(strnlen.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_wcsnlen_REAL'
LINK : warning LNK4217: symbol 'wcsncmp' defined in 'libucrt.lib(wcsncmp.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_wcsncmp_REAL'
LINK : warning LNK4217: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_strncmp_REAL'
LINK : warning LNK4217: symbol 'strnlen' defined in 'libucrt.lib(strnlen.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_strndup_REAL'
LINK : warning LNK4217: symbol 'strpbrk' defined in 'libucrt.lib(strpbrk.obj)' is imported by 'SDL3-static.lib(SDL_string.c.obj)' in function 'SDL_strpbrk_REAL'
LINK : warning LNK4217: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'SDL3-static.lib(SDL_assert.c.obj)' in function 'SDL_PromptAssertion'
LINK : warning LNK4217: symbol 'fflush' defined in 'libucrt.lib(fflush.obj)' is imported by 'SDL3-static.lib(SDL_assert.c.obj)' in function 'SDL_PromptAssertion'
LINK : warning LNK4217: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'SDL3-static.lib(SDL_assert.c.obj)' in function '_vfprintf_l'
LINK : warning LNK4217: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'SDL3-static.lib(SDL_malloc.c.obj)' in function 'real_calloc'
if you want to get more verbose errors, please see:
  -> C:\Users\Deicide\AppData\Local\.xmake\cache\packages\2502\l\libsdl3\3.2.2\installdir.failed\logs\install.txt
error: install failed!
warning: add_cxflags("-stdlib=libc++ "-cxx-isystemC:\\Program Files\\LLVM\\include\\c++\\v1"") is ignored, please pass `{force = true}` or call `set_policy("check.auto_ignore_flags", false)` if you want to set it.
@SirLynix
Copy link
Member

SirLynix commented Feb 9, 2025

Could you post the verbose/diagnosis installation logs? (-vD)

@RoqueDeicide
Copy link
Author

Here you go.

install.log

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

No branches or pull requests

2 participants