Xmake Version
v3.0.7+master.2566a7d29
Operating System Version and Architecture
Windows 11 25H2
Describe Bug
When I build a dynamic library with a Zig codebase on windows, the dll file doesnt contains exported symbols.
(and I need to add add_syslinks("c") to make it works)
Zig version: 0.15.2
I've also made a repository explaining the problem:
https://github.com/Miou-zora/Zig-DynLib-Windows
Expected Behavior
I want to have exported symbols of my zig codebase inside the dll file
Project Configuration
add_rules("mode.debug", "mode.release")
add_requires("zig 0.15.2")
target("ZigDynLibWindows")
set_kind("shared")
add_files("src/exported_function.zig")
set_toolchains("@zig")
if is_plat("windows") then
add_syslinks("c")
end
Additional Information and Error Logs
xmake f -cvD
checking for platform ... windows (x64)
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\bin\HostX64\x64\cl.exe
checking for Microsoft C/C++ Compiler (x64) ... ok
checking for Microsoft Visual Studio (x64) version ... 2026
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for git ... C:\Users\alexa\AppData\Local\.xmake\packages\g\git\2.20.0\65b10f9e7885425fbf2d2abaad2a61a9\share\MinGit\cmd\git.exe
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for 7z ... C:\Users\alexa\xmake\winenv\bin\7z
C:\Users\alexa\AppData\Local\.xmake\packages\g\git\2.20.0\65b10f9e7885425fbf2d2abaad2a61a9\share\MinGit\cmd\git.exe rev-parse HEAD
checking for zig ... no
checking for zig ... C:\Users\alexa\AppData\Local\.xmake\packages\z\zig\0.15.2\ebe55ddddf714323a6cd2869c52a8e6b\zig
configure
{
ndk_stdcxx = true
ccache = true
kind = static
arch = x64
clean = true
vs = 2026
builddir = build
plat = windows
host = windows
mode = release
}
xmake -vD
checking for C:\Users\alexa\AppData\Local\.xmake\packages\z\zig\0.15.2\ebe55ddddf714323a6cd2869c52a8e6b\zig ... c:\users\alexa\appdata\local\.xmake\packages\z\zig\0.15.2\ebe55ddddf714323a6cd2869c52a8e6b\zig.exe
checking for the zig compiler (zc) ... zig.exe
checking for c:\users\alexa\appdata\local\.xmake\packages\z\zig\0.15.2\ebe55ddddf714323a6cd2869c52a8e6b\zig.exe ... ok
checking for flags (-O ReleaseFast) ... ok
> zig.exe "-O" "ReleaseFast" "-target" "x86_64-windows-msvc"
checking for flags (--cache-dir build\.objs\ZigDynLibWindows\windows\x64\release\zig-cache) ... ok
> zig.exe "--cache-dir" "build\.objs\ZigDynLibWindows\windows\x64\release\zig-cache" "-target" "x86_64-windows-msvc"
checking for C:\Users\alexa\AppData\Local\Temp\.xmake\260310\zigcc\c++.cmd ... ok
checking for the c++ compiler (cxx) ... c++.cmd
[ 23%]: compiling.release src\exported_function.zig
c:\users\alexa\appdata\local\.xmake\packages\z\zig\0.15.2\ebe55ddddf714323a6cd2869c52a8e6b\zig.exe build-obj -target x86_64-windows-msvc -fPIC -O ReleaseFast --cache-dir build\.objs\ZigDynLibWindows\windows\x64\release\zig-cache -femit-bin=build\.objs\ZigDynLibWindows\windows\x64\release\src\exported_function.zig.obj src\exported_function.zig
checking for C:\Users\alexa\AppData\Local\.xmake\packages\z\zig\0.15.2\ebe55ddddf714323a6cd2869c52a8e6b\zig ... c:\users\alexa\appdata\local\.xmake\packages\z\zig\0.15.2\ebe55ddddf714323a6cd2869c52a8e6b\zig.exe
checking for the zig shared library linker (zcsh) ... zig.exe
[ 47%]: linking.release ZigDynLibWindows.dll
c:\users\alexa\appdata\local\.xmake\packages\z\zig\0.15.2\ebe55ddddf714323a6cd2869c52a8e6b\zig.exe build-lib -dynamic -fPIC -target x86_64-windows-msvc -fstrip -dead_strip -lc -femit-bin=build\windows\x64\release\ZigDynLibWindows.dll build\.objs\ZigDynLibWindows\windows\x64\release\src\exported_function.zig.obj
checking for C:\Users\alexa\AppData\Local\Temp\.xmake\260310\zigcc\cc.cmd ... ok
checking for the c compiler (cc) ... cc.cmd
build cache stats:
cache directory: build\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 0
cache miss total time: 0.000s
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.000s
[100%]: build ok, spent 1.0s
Xmake Version
v3.0.7+master.2566a7d29
Operating System Version and Architecture
Windows 11 25H2
Describe Bug
When I build a dynamic library with a Zig codebase on windows, the dll file doesnt contains exported symbols.
(and I need to add
add_syslinks("c")to make it works)Zig version: 0.15.2
I've also made a repository explaining the problem:
https://github.com/Miou-zora/Zig-DynLib-Windows
Expected Behavior
I want to have exported symbols of my zig codebase inside the dll file
Project Configuration
Additional Information and Error Logs