diff -ur libpaper-1.1.29/src/paperconf.c libpaper-src/src/paperconf.c
--- libpaper-1.1.29/src/paperconf.c	2024-01-07 11:43:15.000000000 +0900
+++ libpaper-src/src/paperconf.c	2024-01-07 11:43:48.000000000 +0900
@@ -3,9 +3,14 @@
 #include "config.h"
 #endif
 
+#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
+#endif
 
 #include <ctype.h>
+#ifdef _MSC_VER
+#include <getopt.h>
+#endif
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -100,6 +105,10 @@
     const char* progname;
 
     progname = strrchr(*argv, '/');
+#ifdef WIN32
+    if(!progname)
+        progname = strrchr(*argv, '\\');
+#endif
     if (progname) {
 	++progname;
     } else {
