diff --git a/inc/lektor/internal/os.h b/inc/lektor/internal/os.h
index d0f565ce3ba354bad41a73f38af7371da9ccb131..4f04ccf3db7ecd2408e110e81041bd050e465709 100644
--- a/inc/lektor/internal/os.h
+++ b/inc/lektor/internal/os.h
@@ -30,6 +30,8 @@ extern "C" {
 #include "lektor/internal/win32/endian.h"
 #include <processthreadsapi.h>
 #include <windows.h>
+#include <direct.h>
+#include <fcntl.h>
 
 #else
 #include <linux/limits.h>
diff --git a/inc/lektor/internal/worker.h b/inc/lektor/internal/worker.h
index b5d171006502c14d9b9eadcba7c5f2a60ed7e840..6c05933d1c27810739810f61abcaba4063cef92a 100644
--- a/inc/lektor/internal/worker.h
+++ b/inc/lektor/internal/worker.h
@@ -184,8 +184,8 @@ worker_pool_push(struct worker_pool *pool, worker_pool_function func, void *arg)
                     pool->size = 2;
                 size_t nsize = 2 * pool->size;
                 void *new_func =
-                    safe_realloc((void *)pool->functions, nsize * sizeof(worker_pool_function));
-                void *new_args = safe_realloc((void *)pool->args, nsize * sizeof(void *));
+                    safe_realloc((void *)pool->functions, (long unsigned int)nsize * sizeof(worker_pool_function));
+                void *new_args = safe_realloc((void *)pool->args, (long unsigned int)nsize * sizeof(void *));
 
                 pool->size *= 2;
                 pool->functions = new_func;
diff --git a/inc/lektor/net.h b/inc/lektor/net.h
index 22fe26e655116185fbd16aefb0c3c7f69f35c113..75c78da936656bd852b9dc46ca48188f2cd0b5dc 100644
--- a/inc/lektor/net.h
+++ b/inc/lektor/net.h
@@ -56,7 +56,7 @@ struct lkt_state {
 #if defined(LKT_OS_WIN) && (LKT_OS_WIN == 1)
     /* The FDS, Windob' version */
     LPWSAPOLLFD fds;
-    ULONG fds_len;
+    size_t fds_len;
     ULONG fds_max;
 
 #else
diff --git a/src/base/config.c b/src/base/config.c
index 57a3f723730badaf100d2520ab49708d18212c96..04d991c12c83c49590fcc04424cb7db05ee5b8e4 100644
--- a/src/base/config.c
+++ b/src/base/config.c
@@ -224,7 +224,7 @@ config_detect_file(char *conf, size_t conf_len)
     memset(conf, 0, conf_len * sizeof(char));
 
     /* Try the current working dir config file. */
-    if (getcwd(conf, (size_t)(conf_len)-1) != NULL) {
+    if (getcwd(conf, (int)(conf_len)-1) != NULL) {
         strncat(conf, "/lektor.ini", conf_len - 1);
         LOG_INFO("CONFIG", "Trying %s", conf);
         if (!access(conf, R_OK | F_OK))
diff --git a/src/base/launch.c b/src/base/launch.c
index 48dff02c6774be6bdd35fee8a52df5a85bd224e4..6f18d0e738d375694fb953ce0fc715ef61bdbb70 100644
--- a/src/base/launch.c
+++ b/src/base/launch.c
@@ -14,7 +14,9 @@ extern char **environ;
 
 /* Private implementation details */
 
+#if !(defined(LKT_OS_WIN) && (LKT_OS_WIN == 1))
 static pid_t ___klkt_pid  = 0;
+#endif
 static int ___is_appimage = 0;
 
 char exe[PATH_MAX];
diff --git a/src/base/logfile.c b/src/base/logfile.c
index a85decf1c0df7e49b41bb96d57d5f6997f4e0ddb..d462cbcd3bf863e7cbb47130b4975b523a0ff131 100644
--- a/src/base/logfile.c
+++ b/src/base/logfile.c
@@ -54,7 +54,7 @@ ___open_all_files(struct lkt_logfile *logfile)
     char path[PATH_MAX];
     safe_snprintf(path, PATH_MAX, "%s/1", logfile->base_folder);
     logfile->current_lines_in_file = ___count_lines_in_file(path);
-    logfile->current_fd            = open(path, O_APPEND | O_CREAT | O_WRONLY, 0644);
+    logfile->current_fd            = _open(path, O_APPEND | O_CREAT | O_WRONLY, 0644);
     FAIL_IF(logfile->current_fd <= 0, "Failed to open log file: %s", path);
 }
 
diff --git a/src/base/os.c b/src/base/os.c
index 404bc4a435a5b618d23d5d283d29fb8468cbbf70..aecead7ac7869eb68f501ac2fb9517939b82ebef 100644
--- a/src/base/os.c
+++ b/src/base/os.c
@@ -28,6 +28,7 @@ void
 lkt_thread_set_name(const char *name)
 {
 #if defined(LKT_OS_WIN) && (LKT_OS_WIN == 1)
+    (void)name;
 #else
     const size_t len = strlen(name);
     if (len >= 16) {
diff --git a/src/database/cache.c b/src/database/cache.c
index 8b6a0e1a181d282f5061226301a82bf2e01f9a8c..e3b18e963286b9655a0769c1e56bdf1befdc1d3d 100644
--- a/src/database/cache.c
+++ b/src/database/cache.c
@@ -168,7 +168,7 @@ database_cache_kara(lkt_db *db, int id)
         LOG_ERROR("CACHE", "Failed to cache mtime for '%s' kara %d to %ld", filepath, id, mtime);
 
     double duration = 0.;
-    if (kara_read_length(&duration, filepath) || isnan(duration))
+    if (kara_read_length(&duration, filepath) || isnan((float)duration))
         LOG_ERROR("CACHE", "Failed to read lengh of '%s' for kara %d", filepath, id);
 
     uint64_t duration_uint = (uint64_t)duration;
diff --git a/src/database/config.c b/src/database/config.c
index 6771ce792b827db77cbfe5a01ab2d7b2cd79df01..d12f0c3113d17370ebd773170d003f3d249888d9 100644
--- a/src/database/config.c
+++ b/src/database/config.c
@@ -161,7 +161,7 @@ database_config_get_octal(lkt_db *db, const char *section, const char *key, unsi
         return false;
 
     const long octal = strtol(str_value, NULL, 8);
-    if (octal < 0 || octal > UINT_MAX) {
+    if (octal < 0 || (unsigned int)octal > UINT_MAX) {
         LOG_ERROR("DB", "The octal value is negative or to big for a uint!");
         return false;
     }
diff --git a/src/database/open.c b/src/database/open.c
index 8042405f592831b39542cae4c17ed1f27a759002..caa0ec32110eaf18fa32306238e6c4c72bc35b6e 100644
--- a/src/database/open.c
+++ b/src/database/open.c
@@ -199,10 +199,12 @@ bool
 database_open(lkt_db *db, const char *dbpath, bool check)
 {
     bool retry = false;
+#if !defined(LKT_OS_WIN) && (LKT_OS_WIN == 1)
     if (___is_sql_str_invalid(dbpath)) {
         LOG_ERROR("DB", "The database path '%s' is invalid", dbpath);
         return false;
     }
+#endif
 
     /* Try the simple attach, for already initialized database */
 retry:
diff --git a/src/main/lkt.c b/src/main/lkt.c
index f01f8a640a81c23c45777308ced71729c38cda6e..50853bb33513a33b20c8f4e0c3e6a612e50cef1e 100644
--- a/src/main/lkt.c
+++ b/src/main/lkt.c
@@ -279,12 +279,14 @@ create_socket(const char *host_arg, const char *port_arg)
                       "invocation of lkt or an invalid hostname...");
 
         sock     = *found->ai_addr;
-        sock_len = found->ai_addrlen;
+        sock_len = (socklen_t)(found->ai_addrlen);
         freeaddrinfo(found);
 
         ptr_sock = &sock;
         domain   = AF_INET;
+#if !(defined(LKT_OS_WIN) && (LKT_OS_WIN == 1))
     }
+#endif
 
     /* Common part */
     cx = socket(domain, SOCK_STREAM, 0);
@@ -770,7 +772,7 @@ status__(struct cmd_args *args)
 #undef check_end
 
     struct tm *p_tm = localtime(&update_ts);
-    len             = strftime(buff, LKT_MESSAGE_MAX - 1, "%F %H:%M:%S", p_tm);
+    len             = strftime(buff, LKT_MESSAGE_MAX - 1, "%d %H:%M:%S", p_tm); // doc says %F should exists but isn't
     buff[len]       = '\0';
 
     int pla_m = time_pos / 60;
@@ -1163,7 +1165,7 @@ search_get__(struct cmd_args *args)
         memset(buff, 0, LKT_MESSAGE_MAX * sizeof(char));
         read_socket(sock, buff, LKT_MESSAGE_MAX - 1);
         HANDLE_STATUS(buff, { exit(EXIT_SUCCESS); });
-        write(1, buff, strlen(buff));
+        write(1, buff, (unsigned int)strlen(buff));
     }
 }
 
diff --git a/src/mkv/write.c b/src/mkv/write.c
index a8c6d324344c11d209362585fd6661ecfa4a7228..e35903e5d24e9669263545aa530566703002b57c 100644
--- a/src/mkv/write.c
+++ b/src/mkv/write.c
@@ -95,6 +95,7 @@ mkvpropedit__(const char *const args[])
     return true;
 #else
     LOG_ERROR("MKV", "The call to mkvpropedit call is not implemented in windows");
+    (void)args;
     return false;
 #endif
 }
@@ -116,11 +117,16 @@ kara_metadata_write(struct kara_metadata *mdt, const char *filename)
         goto error;
     }
 
+#if !(defined(LKT_OS_WIN) && (LKT_OS_WIN == 1))
+    // dprintf doesn't exist, used _get_osfhandle
     if (dprintf(fd, METADATA_TEMPLATE, mdt->source_name, mdt->song_name, mdt->category,
                 mdt->language, mdt->author_name, mdt->song_type, mdt->song_number) < 0) {
         LOG_ERROR("MKV", "Failed to write to temporary file: %s", metadafilepath);
         goto error;
     }
+#else
+    (void)mdt;
+#endif
 
     if (!mkvpropedit__(args1) || !mkvpropedit__(args2))
         goto error;
diff --git a/src/module/module_repo.c b/src/module/module_repo.c
index c7ac7043d86874f9832ef40eaca2676394fded7e..0756b0d22842587f1e2ca1bdc84e336004009a72 100644
--- a/src/module/module_repo.c
+++ b/src/module/module_repo.c
@@ -211,7 +211,7 @@ ___write_disk(char *data, size_t size, size_t nmem, void *user)
 {
     size_t realsize      = size * nmem;
     struct ___file *file = (struct ___file *)user;
-    RETURN_IF(write(file->fd, data, realsize) != (ssize_t)realsize, "Failed to write", 0);
+    RETURN_IF(write(file->fd, data, (unsigned int)realsize) != (ssize_t)realsize, "Failed to write", 0);
 
     if (file->index < 4) {
         memcpy(file->magic + file->index, data, 4 - file->index);
diff --git a/src/net/listen.c b/src/net/listen.c
index 63e1b946414572e2430021c7dd15dddcdb647afe..e6d357c4c5dc79d640ff839dfbd1d7d4dab6bcd2 100644
--- a/src/net/listen.c
+++ b/src/net/listen.c
@@ -406,8 +406,8 @@ handle_incoming_data(struct lkt_state *srv, size_t i)
     for (;;) {
         /* Recieve some data. */
         const ssize_t n =
-            recv(srv->fds[i].fd, to_socket_size_t(cli->buffer_in + cli->buffer_in_len),
-                 to_socket_size_t(LKT_MESSAGE_MAX - cli->buffer_in_len), 0);
+            recv(srv->fds[i].fd, cli->buffer_in + cli->buffer_in_len,
+                 LKT_MESSAGE_MAX - (int)cli->buffer_in_len, 0);
 
         if (n < 0) {
             if (is_error_would_block(get_last_error()))
@@ -494,11 +494,17 @@ typedef SOCKET (*init_socket_func)(const char *, const char *);
 static void
 init_permission_socket_unix(const char *file, unsigned int perms)
 {
+#if defined(LKT_OS_WIN) && (LKT_OS_WIN == 1)
+    (void)file;
+    (void)perms;
+    return;
+#else
     errno = 0;
     if (chmod(file, to_file_mode_t(perms)) < 0) {
         LOG_FATAL("INIT", "Failed to set '%s' to 0%o: %s", file, perms, strerror(errno));
     }
     LOG_INFO("INIT", "Set socket '%s' to perms 0%o", file, perms);
+#endif
 }
 
 static inline int
@@ -573,11 +579,8 @@ init_listening_socket_unix(const char UNUSED *file, const char UNUSED *type /* =
 
 failure:
     close(fd);
-    return INVALID_SOCKET;
-
-#else
-    return INVALID_SOCKET;
 #endif
+    return INVALID_SOCKET;
 }
 
 PRIVATE_FUNCTION SOCKET
@@ -614,7 +617,7 @@ init_listening_socket_net(const char *host, const char *port)
             goto failure;
         }
 
-        if (bind(fd, p->ai_addr, p->ai_addrlen) != 0) {
+        if (bind(fd, p->ai_addr, (int)p->ai_addrlen) != 0) {
             closesocket(fd);
             LOG_ERROR("INIT", "Failed to bind tcp socket: %s", strerror(errno));
             continue;
@@ -707,7 +710,7 @@ static int
 handle_network_events(struct lkt_state *srv)
 {
     errno       = 0;
-    const int n = poll(srv->fds, srv->fds_len, 100);
+    const int n = poll(srv->fds, (ULONG)srv->fds_len, 100);
     if (n < 0 && errno != EAGAIN && errno != EINTR) {
         perror("poll failed");
         return -1;
@@ -994,11 +997,13 @@ redo:
  * Signal handlers *
  *******************/
 
-static int UNUSED ___lkt_signal_INT  = 0; /* SIGINT  => close the server */
-static int UNUSED ___lkt_signal_QUIT = 0; /* SIGQUIT => close the server */
-static int UNUSED ___lkt_signal_ILL  = 0; /* SIGILL  => NoT veRy HappY   */
-static int UNUSED ___lkt_signal_USR1 = 0; /* SIGUSR1 => not used         */
-static int UNUSED ___lkt_signal_USR2 = 0; /* SIGUSR2 => not used         */
+static int ___lkt_signal_INT  = 0; /* SIGINT  => close the server */
+static int ___lkt_signal_ILL  = 0; /* SIGILL  => NoT veRy HappY   */
+#if !defined(LKT_OS_WIN) && (LKT_OS_WIN == 1)
+static int ___lkt_signal_QUIT = 0; /* SIGQUIT => close the server */
+static int ___lkt_signal_USR1 = 0; /* SIGUSR1 => not used         */
+static int ___lkt_signal_USR2 = 0; /* SIGUSR2 => not used         */
+#endif
 
 PRIVATE_FUNCTION void
 ___signal_handler(int sig)
@@ -1096,7 +1101,7 @@ lkt_listen(struct lkt_state *srv)
     if (fds_max_config <= 0)
         LOG_FATAL("The max_clients number must be a positive integer");
 
-    srv->fds_max = (size_t)fds_max_config;
+    srv->fds_max = (ULONG)fds_max_config;
     srv->fds     = LKT_ALLOC_STRUCT_ARRAY(pollfd, srv->fds_max);
     srv->clients = LKT_ALLOC_STRUCT_ARRAY(lkt_client, srv->fds_max);