I don’t think these system libraries are available in static variant
EDIT:
Even if these libraries were available as static libraries, linking to them would be a bad decision. These libraries are the part of Windows, they update when Windows updates, they always exist on supported systems. In this case, dynamic linking is what you must prefer, as with updates, bugs and vulnerabilities get fixed.
I think that’s why all system components of Windows are only available as dynamic libraries.
It’s a bit confusing on Windows since system DLLs are typically consumed by statically linking with a small stub library which wraps the runtime DLL loading and symbol lookup (e.g. AFAIK Windows doesn’t really have a ‘dynamic linker’).
I don’t know how that’s handled with the Zig build system though, e.g. maybe the .preferred_link_mode = .static is actually doing the right thing and statically links the stub library (which then loads the DLL at runtime).
I downloaded the x86_64-windows-gnu release for gatorcat and ran dumpbin.exe /imports on the executable. It shows dynamic dependencies (I don’t know if that’s the windows term) on those three libraries that you mentioned plus wpcap.dll (and the standard ucrt, kernel32, and ntdll). When I ran the executable it failed to find wpcap.dll.
On windows, I have a system dependency on npcap. So I statically? Link against the npcap SDK, but the npcap SDK dynamically Links against wpcap.dll I guess. Npcap is a kernel level driver for raw packet capture on windows.
I should probably figure out a way to warn the user if they are missing npcap.
is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of all dependent modules…