diff --git a/projects/openttd_vs100.vcxproj b/projects/openttd_vs100.vcxproj
index 940b809c8f..783bf2ee7d 100644
--- a/projects/openttd_vs100.vcxproj
+++ b/projects/openttd_vs100.vcxproj
@@ -428,6 +428,7 @@
+
diff --git a/projects/openttd_vs100.vcxproj.filters b/projects/openttd_vs100.vcxproj.filters
index 9c5ebfcf23..0ccd7e7581 100644
--- a/projects/openttd_vs100.vcxproj.filters
+++ b/projects/openttd_vs100.vcxproj.filters
@@ -507,6 +507,9 @@
Header Files
+
+ Header Files
+
Header Files
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj
index e117f901c1..5e183e8833 100644
--- a/projects/openttd_vs80.vcproj
+++ b/projects/openttd_vs80.vcproj
@@ -986,6 +986,10 @@
RelativePath=".\..\src\engine_type.h"
>
+
+
diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj
index 2898eb7565..f5a0558429 100644
--- a/projects/openttd_vs90.vcproj
+++ b/projects/openttd_vs90.vcproj
@@ -983,6 +983,10 @@
RelativePath=".\..\src\engine_type.h"
>
+
+
diff --git a/source.list b/source.list
index 185859af89..628153da44 100644
--- a/source.list
+++ b/source.list
@@ -161,6 +161,7 @@ engine_base.h
engine_func.h
engine_gui.h
engine_type.h
+error.h
fileio_func.h
fileio_type.h
fios.h
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index a71e018e98..7d7ca7d575 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -11,6 +11,7 @@
#include "../stdafx.h"
#include "../table/sprites.h"
+#include "../error.h"
#include "../gui.h"
#include "../querystring_gui.h"
#include "../company_func.h"
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index a3131b45be..df2aef9bc3 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -12,7 +12,7 @@
#include "../stdafx.h"
#include "../debug.h"
#include "../saveload/saveload.h"
-#include "../gui.h"
+#include "../error.h"
#include "../script/squirrel_class.hpp"
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index 9971951ca6..0a0d788d4c 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -10,7 +10,7 @@
/** @file bridge_gui.cpp Graphical user interface for bridge construction */
#include "stdafx.h"
-#include "gui.h"
+#include "error.h"
#include "command_func.h"
#include "rail.h"
#include "strings_func.h"
diff --git a/src/command.cpp b/src/command.cpp
index d521cda0e2..31c4843f0e 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -11,6 +11,7 @@
#include "stdafx.h"
#include "landscape.h"
+#include "error.h"
#include "gui.h"
#include "command_func.h"
#include "network/network_type.h"
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 4a6bab0a3f..4e364f74e7 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -10,6 +10,7 @@
/** @file company_gui.cpp Company related GUIs. */
#include "stdafx.h"
+#include "error.h"
#include "gui.h"
#include "window_gui.h"
#include "textbuf_gui.h"
diff --git a/src/error.h b/src/error.h
new file mode 100644
index 0000000000..75efb75b80
--- /dev/null
+++ b/src/error.h
@@ -0,0 +1,27 @@
+/* $Id$ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see .
+ */
+
+/** @file error.h Functions related to errors. */
+
+#ifndef ERROR_H
+#define ERROR_H
+
+#include "strings_type.h"
+
+/** Message severity/type */
+enum WarningLevel {
+ WL_INFO, ///< Used for DoCommand-like (and some nonfatal AI GUI) errors/information
+ WL_WARNING, ///< Other information
+ WL_ERROR, ///< Errors (eg. saving/loading failed)
+ WL_CRITICAL, ///< Critical errors, the MessageBox is shown in all cases
+};
+
+void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x = 0, int y = 0, uint textref_stack_size = 0, const uint32 *textref_stack = NULL);
+
+#endif /* ERROR_H */
diff --git a/src/error_gui.cpp b/src/error_gui.cpp
index a487f0f2ae..d02ebc15c5 100644
--- a/src/error_gui.cpp
+++ b/src/error_gui.cpp
@@ -12,7 +12,7 @@
#include "stdafx.h"
#include "landscape.h"
#include "newgrf_text.h"
-#include "gui.h"
+#include "error.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "string_func.h"
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 5370cfd293..4a56d2ce6f 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -11,6 +11,7 @@
#include "stdafx.h"
#include "saveload/saveload.h"
+#include "error.h"
#include "gui.h"
#include "gfx_func.h"
#include "command_func.h"
diff --git a/src/gui.h b/src/gui.h
index 823423575f..4859fe79e8 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -55,16 +55,6 @@ void ShowSubsidiesList();
void ShowEstimatedCostOrIncome(Money cost, int x, int y);
-/** Message severity/type */
-enum WarningLevel {
- WL_INFO, ///< Used for DoCommand-like (and some nonfatal AI GUI) errors/information
- WL_WARNING, ///< Other information
- WL_ERROR, ///< Errors (eg. saving/loading failed)
- WL_CRITICAL, ///< Critical errors, the MessageBox is shown in all cases
-};
-
-void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x = 0, int y = 0, uint textref_stack_size = 0, const uint32 *textref_stack = NULL);
-
void ShowExtraViewPortWindow(TileIndex tile = INVALID_TILE);
void ShowExtraViewPortWindowForTileUnderCursor();
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index c05e7365cd..1e6531fb0c 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -13,7 +13,7 @@
#include "heightmap.h"
#include "clear_map.h"
#include "void_map.h"
-#include "gui.h"
+#include "error.h"
#include "saveload/saveload.h"
#include "bmp.h"
#include "gfx_func.h"
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 9c2e825f6f..7a5a588630 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -10,6 +10,7 @@
/** @file industry_gui.cpp GUIs related to industries. */
#include "stdafx.h"
+#include "error.h"
#include "gui.h"
#include "sound_func.h"
#include "window_func.h"
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp
index 894f54dc47..388587fb22 100644
--- a/src/intro_gui.cpp
+++ b/src/intro_gui.cpp
@@ -10,6 +10,7 @@
/** @file intro_gui.cpp The main menu GUI. */
#include "stdafx.h"
+#include "error.h"
#include "gui.h"
#include "window_gui.h"
#include "textbuf_gui.h"
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 5e16f1185e..3ea9dff0fd 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -12,6 +12,7 @@
#include "stdafx.h"
#include "debug.h"
#include "landscape.h"
+#include "error.h"
#include "gui.h"
#include "viewport_func.h"
#include "gfx_func.h"
diff --git a/src/music_gui.cpp b/src/music_gui.cpp
index 846c2bcb69..d4c3057dea 100644
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -19,7 +19,7 @@
#include "sound_func.h"
#include "gfx_func.h"
#include "core/random_func.hpp"
-#include "gui.h"
+#include "error.h"
#include "core/geometry_func.hpp"
#include "string_func.h"
#include "settings_type.h"
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 5e03e638a6..cc6c79e8ed 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -26,7 +26,7 @@
#include "../core/random_func.hpp"
#include "../date_func.h"
#include "../gfx_func.h"
-#include "../gui.h"
+#include "../error.h"
#include "../rev.h"
#include "network.h"
#include "network_base.h"
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp
index 98c9f171b3..179603768c 100644
--- a/src/network/network_content.cpp
+++ b/src/network/network_content.cpp
@@ -15,7 +15,7 @@
#include "../rev.h"
#include "../ai/ai.hpp"
#include "../window_func.h"
-#include "../gui.h"
+#include "../error.h"
#include "../base_media_base.h"
#include "../settings_type.h"
#include "network_content.h"
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 3b008832d3..fa16238b2e 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -14,7 +14,7 @@
#include "../strings_func.h"
#include "../gfx_func.h"
#include "../window_func.h"
-#include "../gui.h"
+#include "../error.h"
#include "../ai/ai.hpp"
#include "../base_media_base.h"
#include "../sortlist_type.h"
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 49e8cf3eb0..52de2703cb 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -45,7 +45,7 @@
#include