diff --git a/daemon/src/history/history.cpp b/daemon/src/history/history.cpp
index 16482fde4656b9ef4b1dd872780aec13e57ce5bb..ccc41a7da09f09fae219efefd0432c5d8ab2c517 100644
--- a/daemon/src/history/history.cpp
+++ b/daemon/src/history/history.cpp
@@ -33,6 +33,7 @@
 #include "history.h"
 #include <cerrno>
 #include <algorithm>
+#include <fstream>
 #include <sys/stat.h> // for mkdir
 #include <ctime>
 #include "global.h"