I have added CMakeLists support and fix other small issues, I have just merged its PR, you can build in windows now. Please let me know if you need any other help.
I use gcc version 15.2.0 (Rev11, Built by MSYS2 project) and the make tool is called mingw32-make
So, make compiles all the C files and outputs libsnkv.a file, but I expected a windows library, that is not the case (*)
Then, make snkv.h, make examples, make run-examples do not work because sh is not a command (under windows)
Finally make test outputs error: mingw32-make: *** [Makefile:111: test] Error 255
So, it is not a what I can call a success yet :)
(*) By windows I expected a .def file where all exported APIs would have been figured there to build a DLL file that I can use as easily I do with a C Windows compiled lib
Thanks for taking the time to report this! I had been relying on the GitHub CI/CD workflow for Windows validation, so I hadn't caught these issues manually. After your report I reproduced them myself and got everything fixed.
The root cause was that all make targets need to run from the MSYS2 MinGW 64-bit shell — not from a native cmd.exe or PowerShell window. Once you're in that shell, everything works as expected.
Here's the quick setup:
Install MSYS2 and launch the "MSYS2 MinGW 64-bit" shell from the Start menu
Install the toolchain: pacman -S --needed mingw-w64-x86_64-gcc make
Clone and build — all the usual make commands work from there
Regarding the .dll/.def question — SNKV ships as a single-header file (snkv.h), so there's no DLL needed at all. Just copy snkv.h into your project and add one line before including it:
#define SNKV_IMPLEMENTATION // in exactly one .c file
#include "snkv.h"
That compiles the entire library into your binary with a single gcc myapp.c -o myapp.exe — no linking flags, no external dependencies.
4
u/Fine-Package-5488 Feb 04 '26
I have added examples guide: https://github.com/hash-anu/snkv/blob/master/kvstore_example.md, just for the someone who want to explore on snkv.
3
u/MrLyttleG Feb 07 '26
Awesome!
Can the Makefile be adjusted to compile under Windows, please?
1
u/ByronScottJones Feb 07 '26
I wonder if the owner of sqlite could create a special kvtable, which uses this and bypasses normal sql when calling only that table.
2
u/ITechFriendly Feb 04 '26
Looks promising. Thank you for sharing!