diff --git a/amiga/gui.c b/amiga/gui.c
index f186328fe..e482f5242 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -145,6 +145,8 @@
#define EXTRADOWN (IECODE_5TH_BUTTON)
#define EXTRAUP (IECODE_5TH_BUTTON | IECODE_UP_PREFIX)
+extern struct gui_utf8_table *amiga_utf8_table;
+
struct ami_gui_tb_userdata {
struct List *sblist;
struct gui_window_2 *gw;
diff --git a/atari/encoding.c b/atari/encoding.c
index f57a3d770..d0af00af3 100644
--- a/atari/encoding.c
+++ b/atari/encoding.c
@@ -16,6 +16,8 @@
* along with this program. If not, see .
*/
+#include "desktop/gui.h"
+
#include "atari/encoding.h"
diff --git a/cocoa/fetch.m b/cocoa/fetch.m
index 7bf00e0ba..70d3805e1 100644
--- a/cocoa/fetch.m
+++ b/cocoa/fetch.m
@@ -19,6 +19,7 @@
#import
#import "utils/log.h"
+#import "utils/nsurl.h"
#import "desktop/gui.h"
#import "cocoa/fetch.h"
diff --git a/riscos/ucstables.c b/riscos/ucstables.c
index 3b7f8a42b..62f0b974b 100644
--- a/riscos/ucstables.c
+++ b/riscos/ucstables.c
@@ -27,12 +27,14 @@
#include
#include "utils/config.h"
-#include "riscos/ucstables.h"
+#include "utils/nserrors.h"
#include "utils/log.h"
#include "utils/utf8.h"
#include "utils/utils.h"
#include "desktop/gui.h"
+#include "riscos/ucstables.h"
+
/* Common values (ASCII) */
#define common \
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \