diff --git a/src/d_main.c b/src/d_main.c
index 07e15aec4e3488a922a670432def281f2ffe09ca..07a7ecf91038f802742077a283c3c1691d545529 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -125,6 +125,8 @@ boolean advancedemo;
 INT32 debugload = 0;
 #endif
 
+char savegamename[256];
+
 char srb2home[256] = ".";
 char srb2path[256] = ".";
 boolean usehome = true;
diff --git a/src/doomdef.h b/src/doomdef.h
index 6112881fbd8c6b7ba445beb67065d672b6baef8c..4b425dc729000a508b8e74d2fc9378283fccb32a 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -458,7 +458,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG;
 
 // Things that used to be in dstrings.h
 #define SAVEGAMENAME "srb2sav"
-char savegamename[256];
+extern char savegamename[256];
 
 // m_misc.h
 #ifdef GETTEXT
diff --git a/src/doomstat.h b/src/doomstat.h
index 1ec03a86cd438b1425a251942e909170589809c0..0c2f1e975144d8ef9464afd57692539a56df4a3e 100644
--- a/src/doomstat.h
+++ b/src/doomstat.h
@@ -545,7 +545,7 @@ extern recorddata_t *mainrecords[NUMMAPS];
 extern UINT8 mapvisited[NUMMAPS];
 
 // Temporary holding place for nights data for the current map
-nightsdata_t ntemprecords;
+extern nightsdata_t ntemprecords;
 
 extern UINT32 token; ///< Number of tokens collected in a level
 extern UINT32 tokenlist; ///< List of tokens collected
diff --git a/src/mserv.h b/src/mserv.h
index 6d91da64395be09b8b7eda1d87e9718767a49fdd..5f9b8da5f430f5cbc384ba3497de3845fcb5c8b6 100644
--- a/src/mserv.h
+++ b/src/mserv.h
@@ -68,7 +68,7 @@ extern consvar_t cv_masterserver, cv_servername;
 // < 0 to not connect (usually -1) (offline mode)
 // == 0 to show all rooms, not a valid hosting room
 // anything else is whatever room the MS assigns to that number (online mode)
-INT16 ms_RoomId;
+extern INT16 ms_RoomId;
 
 const char *GetMasterServerPort(void);
 const char *GetMasterServerIP(void);
diff --git a/src/s_sound.c b/src/s_sound.c
index d108363eb0b962be292f88bad40112626c3601ce..5ed9fd83a22d8f475c7400878db264d329a42bd1 100644
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -134,6 +134,7 @@ consvar_t cv_playmusicifunfocused = {"playmusicifunfocused", "No", CV_SAVE, CV_Y
 consvar_t cv_playsoundsifunfocused = {"playsoundsifunfocused", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
 
 #ifdef HAVE_OPENMPT
+openmpt_module *openmpt_mhandle = NULL;
 static CV_PossibleValue_t interpolationfilter_cons_t[] = {{0, "Default"}, {1, "None"}, {2, "Linear"}, {4, "Cubic"}, {8, "Windowed sinc"}, {0, NULL}};
 consvar_t cv_modfilter = {"modfilter", "0", CV_SAVE|CV_CALL, interpolationfilter_cons_t, ModFilter_OnChange, 0, NULL, NULL, 0, 0, NULL};
 #endif
@@ -1910,6 +1911,10 @@ UINT32 S_GetMusicPosition(void)
 /// In this section: mazmazz doesn't know how to do dynamic arrays or struct pointers!
 /// ------------------------
 
+char music_stack_nextmusname[7];
+boolean music_stack_noposition = false;
+UINT32 music_stack_fadeout = 0;
+UINT32 music_stack_fadein = 0;
 static musicstack_t *music_stacks = NULL;
 static musicstack_t *last_music_stack = NULL;
 
diff --git a/src/s_sound.h b/src/s_sound.h
index 119722af43a23e5910581be41a67d615b38061a4..3334fcb69d7bf18820776130c627ba948b1ecb52 100644
--- a/src/s_sound.h
+++ b/src/s_sound.h
@@ -22,7 +22,7 @@
 
 #ifdef HAVE_OPENMPT
 #include "libopenmpt/libopenmpt.h"
-openmpt_module *openmpt_mhandle;
+extern openmpt_module *openmpt_mhandle;
 #endif
 
 // mask used to indicate sound origin is player item pickup
@@ -262,10 +262,10 @@ typedef struct musicstack_s
     struct musicstack_s *next;
 } musicstack_t;
 
-char music_stack_nextmusname[7];
-boolean music_stack_noposition;
-UINT32 music_stack_fadeout;
-UINT32 music_stack_fadein;
+extern char music_stack_nextmusname[7];
+extern boolean music_stack_noposition;
+extern UINT32 music_stack_fadeout;
+extern UINT32 music_stack_fadein;
 
 void S_SetStackAdjustmentStart(void);
 void S_AdjustMusicStackTics(void);
@@ -333,7 +333,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum);
 #ifdef MUSICSLOT_COMPATIBILITY
 // For compatibility with code/scripts relying on older versions
 // This is a list of all the "special" slot names and their associated numbers
-const char *compat_special_music_slots[16];
+extern const char *compat_special_music_slots[16];
 #endif
 
 #endif