add_rules("mode.debug", "mode.release")
set_policy("build.sanitizer.address", true)
set_toolchains("clang-cl")
set_toolset("ld", "lld-link")
add_requires("libzippp")
add_requireconfs("libzippp.libzip", {configs = {toolchains = "clang"}})
target("libzippp_test")
set_kind("binary")
add_packages("libzippp")
add_files("src/*.cpp")
➜ xmake -vD
checking for platform ... windows (x64)
checking for cl.exe ... D:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.51.36231\bin\HostX64\x64\cl.exe
checking for Microsoft C/C++ Compiler (x64) ... ok
checking for Microsoft Visual Studio (x64) version ... 2026
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for dotnet ... C:\Program Files\dotnet\dotnet.exe
checking for .NET SDK version ... 8.0.422
checking for .NET SDK directory ... C:\Program Files\dotnet\sdk\8.0.422
checking for git ... D:\scoop\apps\git\current\bin\git.exe
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for 7z ... D:\scoop\apps\xmake\current\winenv\bin\7z
D:\scoop\apps\git\current\bin\git.exe rev-parse HEAD
checking for clang-cl.exe ... D:\scoop\apps\llvm\current\bin\clang-cl.exe
checking for LLVM Clang C/C++ Compiler (x64) ... ok
checking for llvm resource dir ... D:\scoop\apps\llvm\22.1.8\lib\clang\22
checking for llvm target triple ... x86_64-pc-windows-msvc
checking for Microsoft Visual Studio (x64) version ... 2026
checking for clang ... D:\scoop\apps\llvm\current\bin\clang
checking for LLVM Clang C/C++ Compiler (x64) ... ok
checking for llvm resource dir ... D:\scoop\apps\llvm\22.1.8\lib\clang\22
checking for llvm target triple ... x86_64-pc-windows-msvc
checking for Microsoft Visual Studio (x64) version ... 2026
checking for ninja ... no
checking for ninja ... no
checking for ninja ... D:\scoop\shims\ninja.exe
checking for cmake ... no
checking for cmake ... no
finding zlib from xmake ..
checking for xmake::zlib ... zlib v1.3.2
finding libzip from xmake ..
checking for xmake::libzip ... libzip v1.10.1
finding libzippp from xmake ..
checking for xmake::libzippp ... no
finding libzippp from vcpkg ..
checking for vcpkg.exe ... D:\scoop\apps\vcpkg\current\vcpkg.exe
finding libzippp from conan ..
finding libzippp from system ..
checking for clang-cl ... D:\scoop\apps\llvm\22.1.8\bin\clang-cl
checking for the c compiler (cc) ... clang-cl
> D:\scoop\apps\llvm\22.1.8\bin\clang-cl -c --target=x86_64-pc-windows-msvc -FoF:\xmake\.xmake\tmp\.xmake\260622\_f3f47a3fec4140ced8c370637a699ac7.o F:\xmake\.xmake\tmp\.xmake\260622\_5c2289377258fd5de3785c74a50568f0.c
checking for D:\scoop\apps\llvm\22.1.8\bin\clang-cl ... d:\scoop\apps\llvm\22.1.8\bin\clang-cl.exe
checking for flags (-fcolor-diagnostics) ... ok
> clang-cl.exe "-fcolor-diagnostics" "--target=x86_64-pc-windows-msvc"
checking for flags (-fansi-escape-codes) ... ok
> clang-cl.exe "-fansi-escape-codes" "--target=x86_64-pc-windows-msvc"
checking for link.exe ... D:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.51.36231\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
> "D:\\Program Files\\Microsoft Visual Studio\\VC\\Tools\\MSVC\\14.51.36231\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 libzippp.lib -out:F:\xmake\.xmake\tmp\.xmake\260622\_f3f47a3fec4140ced8c370637a699ac7.b F:\xmake\.xmake\tmp\.xmake\260622\_f3f47a3fec4140ced8c370637a699ac7.o
> checking for c links(libzippp)
> checking for c snippet(find_package/libzippp)
checkinfo: ...gramdir\core\sandbox\modules\import\core\tool\linker.lua:75: @programdir\modules\core\tools\link.lua:199: LINK : fatal error LNK1181: 无法打开输入文件“libzippp.lib”
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:1193]:
[@programdir\modules\core\tools\link.lua:199]: in function 'catch'
[@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
[@programdir\modules\core\tools\link.lua:174]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]:
[@programdir\core\tool\linker.lua:245]: in function 'link'
[...gramdir\core\sandbox\modules\import\core\tool\linker.lua:73]: in function 'link'
[@programdir\modules\lib\detect\check_cxsnippets.lua:255]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
[@programdir\modules\lib\detect\check_cxsnippets.lua:243]:
[@programdir\modules\package\manager\system\find_package.lua:73]:
[@programdir\modules\package\manager\find_package.lua:86]: in function '_find_package_with_builtin_rule'
[@programdir\modules\package\manager\find_package.lua:132]: in function '_find_package'
[@programdir\modules\package\manager\find_package.lua:208]:
[@programdir\modules\lib\detect\find_package.lua:92]:
[@programdir\core\package\package.lua:1950]: in function '_fetch_library'
[@programdir\core\package\package.lua:2123]: in function 'fetch'
[...modules\private\action\require\impl\install_packages.lua:354]: in function 'job_func'
[@programdir\modules\async\runjobs.lua:462]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
[@programdir\modules\async\runjobs.lua:431]: in function 'cotask'
[@programdir\core\base\scheduler.lua:531]:
checking for libzippp ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
-> libzippp 7.1 [asan:y, runtimes:"MD", toolchains:"clang-cl"]
please input: y (y/n/m)
checking for curl ... D:\scoop\apps\xmake\current\winenv\bin\curl
pinging the host(github.com) ... 177 ms
checking for tar ... C:\Windows\System32\tar.exe
C:\Windows\System32\tar.exe -xf F:\xmake\.xmake\cache\packages\2606\l\libzippp\7.1\libzippp-7.1.tar.gz
checking for ninja ... D:\scoop\shims\ninja.exe
checking for clang-cl ... D:\scoop\apps\llvm\22.1.8\bin\clang-cl
checking for the c++ compiler (cxx) ... clang-cl
checking for cmake ... F:\xmake\.xmake\packages\c\cmake\4.2.3\674adf9609f646bc9f678b5e946b080a\bin\cmake.exe
checkinfo: cannot runv(pkgconf.exe --version), No such file or directory
checking for pkgconf ... no
checkinfo: cannot runv(pkg-config.exe --version), No such file or directory
checking for pkg-config ... no
checking for link.exe ... D:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.51.36231\bin\HostX64\x64\link.exe
checking for the static library archiver (ar) ... link.exe
checking for link.exe ... D:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.51.36231\bin\HostX64\x64\link.exe
checking for the shared library linker (sh) ... link.exe
checkinfo: cannot runv(pkgconf.exe --version), No such file or directory
checking for pkgconf ... no
checkinfo: cannot runv(pkg-config.exe --version), No such file or directory
checking for pkg-config ... no
F:\xmake\.xmake\packages\c\cmake\4.2.3\674adf9609f646bc9f678b5e946b080a\bin\cmake.exe -DLIBZIPPP_BUILD_TESTS=OFF -DLIBZIPPP_CMAKE_CONFIG_MODE=ON -DLIBZIPPP_GNUINSTALLDIRS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DLIBZIPPP_ENABLE_ENCRYPTION=OFF -DCMAKE_INSTALL_PREFIX=F:\xmake\.xmake\packages\l\libzippp\7.1\3934e75a3a454618b29015f6a198f808 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G Ninja -DCMAKE_MAKE_PROGRAM=D:\scoop\shims\ninja.exe -DCMAKE_LINKER_TYPE=MSVC -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_COMPILER=D:/scoop/apps/llvm/22.1.8/bin/clang-cl.exe -DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=F:/xmake/.xmake/cache/packages/2606/l/libzippp/7.1/source/build_4b64070b/pdb -DCMAKE_PDB_OUTPUT_DIRECTORY=F:/xmake/.xmake/cache/packages/2606/l/libzippp/7.1/source/build_4b64070b/pdb -DCMAKE_C_COMPILER=D:/scoop/apps/llvm/22.1.8/bin/clang-cl.exe -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_POLICY_VERSION_MINIMUM=3.5 "-DCMAKE_CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc --target=x86_64-pc-windows-msvc -fsanitize=address" "-DCMAKE_C_FLAGS=/DWIN32 /D_WINDOWS --target=x86_64-pc-windows-msvc -fsanitize=address" "-DCMAKE_SHARED_LINKER_FLAGS_DEBUG=/debug /INCREMENTAL" "-DCMAKE_CXX_FLAGS_DEBUG=/Zi /Ob0 /Od /RTC1 -MD" -DCMAKE_STATIC_LINKER_FLAGS_DEBUG= -DCMAKE_STATIC_LINKER_FLAGS=/machine:x64 "-DCMAKE_EXE_LINKER_FLAGS_DEBUG=/debug /INCREMENTAL" "-DCMAKE_C_FLAGS_DEBUG=/Zi /Ob0 /Od /RTC1 -MD" F:\xmake\.xmake\cache\packages\2606\l\libzippp\7.1\source
-- The CXX compiler identification is Clang 22.1.8 with MSVC-like command-line
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/scoop/apps/llvm/22.1.8/bin/clang-cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: F:/xmake/.xmake/packages/z/zlib/v1.3.2/9b379ce503ff49199a934ef3e417d47f/lib/zlib.lib (found suitable version "1.3.2", minimum required is "1.1.2")
-- Configuring done (3.3s)
-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_C_COMPILER
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
-- Build files have been written to: F:/xmake/.xmake/cache/packages/2606/l/libzippp/7.1/source/build_4b64070b
checkinfo: cannot runv(pkgconf.exe --version), No such file or directory
checking for pkgconf ... no
checkinfo: cannot runv(pkg-config.exe --version), No such file or directory
checking for pkg-config ... no
D:\scoop\shims\ninja.exe install -C F:\xmake\.xmake\cache\packages\2606\l\libzippp\7.1\source\build_4b64070b -v -j 18
ninja: Entering directory `F:\xmake\.xmake\cache\packages\2606\l\libzippp\7.1\source\build_4b64070b'
[1/3] D:\scoop\apps\llvm\22.1.8\bin\clang-cl.exe /nologo -TP -IF:\xmake\.xmake\cache\packages\2606\l\libzippp\7.1\source\src -imsvcF:\xmake\.xmake\packages\l\libzip\v1.10.1\49efe61605714916a25941f07f7905ed\include /DWIN32 /D_WINDOWS /GR /EHsc --target=x86_64-pc-windows-msvc -fsanitize=address /Zi /Ob0 /Od /RTC1 -MD -MD /showIncludes /FoCMakeFiles\libzippp.dir\src\libzippp.cpp.obj /Fdpdb\ -c -- F:\xmake\.xmake\cache\packages\2606\l\libzippp\7.1\source\src\libzippp.cpp
[2/3] C:\WINDOWS\system32\cmd.exe /C "cd . && D:\scoop\apps\llvm\22.1.8\bin\llvm-lib.exe /nologo /machine:x64 /out:libzippp_static.lib CMakeFiles\libzippp.dir\src\libzippp.cpp.obj && cd ."
[2/3] C:\WINDOWS\system32\cmd.exe /C "cd /D F:\xmake\.xmake\cache\packages\2606\l\libzippp\7.1\source\build_4b64070b && F:\xmake\.xmake\packages\c\cmake\4.2.3\674adf9609f646bc9f678b5e946b080a\bin\cmake.exe -P cmake_install.cmake"
-- Install configuration: "Debug"
-- Installing: F:/xmake/.xmake/packages/l/libzippp/7.1/3934e75a3a454618b29015f6a198f808/lib/libzippp_static.lib
-- Installing: F:/xmake/.xmake/packages/l/libzippp/7.1/3934e75a3a454618b29015f6a198f808/include/libzippp/libzippp.h
-- Installing: F:/xmake/.xmake/packages/l/libzippp/7.1/3934e75a3a454618b29015f6a198f808/lib/cmake/libzippp/libzipppConfig.cmake
-- Installing: F:/xmake/.xmake/packages/l/libzippp/7.1/3934e75a3a454618b29015f6a198f808/lib/cmake/libzippp/libzipppConfigVersion.cmake
-- Installing: F:/xmake/.xmake/packages/l/libzippp/7.1/3934e75a3a454618b29015f6a198f808/lib/cmake/libzippp/libzipppTargets.cmake
-- Installing: F:/xmake/.xmake/packages/l/libzippp/7.1/3934e75a3a454618b29015f6a198f808/lib/cmake/libzippp/libzipppTargets-debug.cmake
finding libzippp from xmake ..
checking for xmake::libzippp ... libzippp 7.1
{
version = "7.1",
links = {
"libzippp_static"
},
sysincludedirs = {
"F:\xmake\.xmake\packages\l\libzippp\7.1\3934e75a3a454618b29015f6a198f808\include"
},
static = true,
linkdirs = {
"F:\xmake\.xmake\packages\l\libzippp\7.1\3934e75a3a454618b29015f6a198f808\lib"
},
libfiles = {
"F:\xmake\.xmake\packages\l\libzippp\7.1\3934e75a3a454618b29015f6a198f808\lib\libzippp_static.lib"
}
}
patching F:\xmake\.xmake\packages\l\libzippp\7.1\3934e75a3a454618b29015f6a198f808\lib\pkgconfig\libzippp.pc ..
checking for flags (-fsanitize=address) ... ok
> clang-cl.exe "-fsanitize=address" "--target=x86_64-pc-windows-msvc"
checking for flags (-MD) ... ok
> clang-cl.exe "-MD" "--target=x86_64-pc-windows-msvc"
checking for flags (cl_external_includedir) ... ok
> clang-cl.exe "-external:W0" "-external:IF:\xmake\.xmake\packages\l\libzippp\7.1\3934e75a3a454618b29015f6a198f808\include" "--target=x86_64-pc-windows-msvc"
> D:\scoop\apps\llvm\22.1.8\bin\clang-cl -c --target=x86_64-pc-windows-msvc -fsanitize=address -MD -std:c++11 -DZIP_STATIC -external:W0 -external:IF:\xmake\.xmake\packages\l\libzippp\7.1\3934e75a3a454618b29015f6a198f808\include -external:W0 -external:IF:\xmake\.xmake\packages\l\libzip\v1.10.1\49efe61605714916a25941f07f7905ed\include -external:W0 -external:IF:\xmake\.xmake\packages\z\zlib\v1.3.2\9b379ce503ff49199a934ef3e417d47f\include -FoF:\xmake\.xmake\tmp\.xmake\260622\_5013a58f9eae3eb79571822a76f5c929.o F:\xmake\.xmake\tmp\.xmake\260622\_c74e8cb7e13e093eee8324876adb6b34.cpp
checking for flags (-fcolor-diagnostics) ... ok
> clang-cl.exe "-fcolor-diagnostics" "--target=x86_64-pc-windows-msvc"
checking for flags (-fansi-escape-codes) ... ok
> clang-cl.exe "-fansi-escape-codes" "--target=x86_64-pc-windows-msvc"
clang-cl: warning: argument unused during compilation: '-std:c++11' [-Wunused-command-line-argument]
> "D:\\Program Files\\Microsoft Visual Studio\\VC\\Tools\\MSVC\\14.51.36231\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 D:/scoop/apps/llvm/22.1.8/lib/clang/22/lib/windows/clang_rt.asan_dynamic-x86_64.lib /WHOLEARCHIVE:D:/scoop/apps/llvm/22.1.8/lib/clang/22/lib/windows/clang_rt.asan_dynamic_runtime_thunk-x86_64.lib /INFERASANLIBS:NO -libpath:F:\xmake\.xmake\packages\l\libzippp\7.1\3934e75a3a454618b29015f6a198f808\lib -libpath:F:\xmake\.xmake\packages\l\libzip\v1.10.1\49efe61605714916a25941f07f7905ed\lib -libpath:F:\xmake\.xmake\packages\z\zlib\v1.3.2\9b379ce503ff49199a934ef3e417d47f\lib libzippp_static.lib zip.lib zlib.lib advapi32.lib bcrypt.lib -out:F:\xmake\.xmake\tmp\.xmake\260622\_5013a58f9eae3eb79571822a76f5c929.b F:\xmake\.xmake\tmp\.xmake\260622\_5013a58f9eae3eb79571822a76f5c929.o
> checking for c++ includes(libzippp/libzippp.h)
> checking for c++ links(libzippp_static, zip, zlib, advapi32, bcrypt)
> checking for c++ snippet(test)
checkinfo: ...gramdir\core\sandbox\modules\import\core\tool\linker.lua:75: @programdir\modules\core\tools\link.lua:199: LINK : fatal error LNK1104: 无法打开文件“windows\clang_rt.builtins-x86_64.lib”
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:1193]:
[@programdir\modules\core\tools\link.lua:199]: in function 'catch'
[@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
[@programdir\modules\core\tools\link.lua:174]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]:
[@programdir\core\tool\linker.lua:245]: in function 'link'
[...gramdir\core\sandbox\modules\import\core\tool\linker.lua:73]: in function 'link'
[@programdir\modules\lib\detect\check_cxsnippets.lua:255]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
[@programdir\modules\lib\detect\check_cxsnippets.lua:243]:
[...ke\repositories\xmake-repo\packages\l\libzippp\xmake.lua:57]: in function 'script'
[...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
[...dir\modules\private\action\require\impl\actions\test.lua:49]:
[...\modules\private\action\require\impl\actions\install.lua:528]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
[...\modules\private\action\require\impl\actions\install.lua:452]:
[...modules\private\action\require\impl\install_packages.lua:514]: in function 'job_func'
[@programdir\modules\async\runjobs.lua:462]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
[@programdir\modules\async\runjobs.lua:431]: in function 'cotask'
[@programdir\core\base\scheduler.lua:531]:
error: ...ke\repositories\xmake-repo\packages\l\libzippp\xmake.lua:57: ...gramdir\core\sandbox\modules\import\core\tool\linker.lua:75: @programdir\modules\core\tools\link.lua:199: LINK : fatal error LNK1104: 无法打开文件“windows\clang_rt.builtins-x86_64.lib”
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:1193]:
[@programdir\modules\core\tools\link.lua:199]: in function 'catch'
[@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
[@programdir\modules\core\tools\link.lua:174]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]:
[@programdir\core\tool\linker.lua:245]: in function 'link'
[...gramdir\core\sandbox\modules\import\core\tool\linker.lua:73]: in function 'link'
[@programdir\modules\lib\detect\check_cxsnippets.lua:255]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
[@programdir\modules\lib\detect\check_cxsnippets.lua:243]:
[...ke\repositories\xmake-repo\packages\l\libzippp\xmake.lua:57]: in function 'script'
[...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
[...dir\modules\private\action\require\impl\actions\test.lua:49]:
[...\modules\private\action\require\impl\actions\install.lua:528]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
[...\modules\private\action\require\impl\actions\install.lua:452]:
[...modules\private\action\require\impl\install_packages.lua:514]: in function 'job_func'
[@programdir\modules\async\runjobs.lua:462]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:299]: in function 'trycall'
[@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
[@programdir\modules\async\runjobs.lua:431]: in function 'cotask'
[@programdir\core\base\scheduler.lua:531]:
=> install libzippp 7.1 .. failed
error: @programdir\core\main.lua:274: @programdir\core\sandbox\modules\import\core\base\task.lua:65: @programdir\modules\async\runjobs.lua:282: ...\modules\private\action\require\impl\actions\install.lua:597: install failed!
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:1193]:
[...\modules\private\action\require\impl\actions\install.lua:597]: in function 'catch'
[@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
[...\modules\private\action\require\impl\actions\install.lua:452]:
[...modules\private\action\require\impl\install_packages.lua:514]: in function 'job_func'
[@programdir\modules\async\runjobs.lua:462]:
stack traceback:
[C]: in global 'error'
@programdir\core\base\os.lua:1193: in function 'base/os.raiselevel'
(...tail calls...)
@programdir\core\main.lua:274: in upvalue 'cotask'
@programdir\core\base\scheduler.lua:531: in function <@programdir\core\base\scheduler.lua:524>
warning: package:buildir() has been deprecated, please use package:builddir()
Xmake 版本
v3.0.9+HEAD.2b184e178
操作系统版本和架构
Windows 11 25H2
描述问题
使用clang-cl编译安装依赖时报错:
安装依赖时报错:LINK : fatal error LNK1104: 无法打开文件“windows\clang_rt.builtins-x86_64.lib”但系统中是有需要的库文件的:

可能相关:#7337
期待的结果
正常编译安装
工程配置
附加信息和错误日志