diff --git a/xs/xsp/GCodeSender.xsp b/xs/xsp/GCodeSender.xsp
index 9ff9281bf..9c55194e5 100644
--- a/xs/xsp/GCodeSender.xsp
+++ b/xs/xsp/GCodeSender.xsp
@@ -3,6 +3,7 @@
 #ifdef BOOST_LIBS
 
 %{
+#include <xsinit.h>
 #include "libslic3r/GCodeSender.hpp"
 %}