diff --git a/libavcodec/w32thread.c b/libavcodec/w32thread.c
index 1659fd3031aae545acd3250e1df6800d8848e619..f2b8f5b3652afdca57cb0d5cb677c0bc7385f5c3 100644
--- a/libavcodec/w32thread.c
+++ b/libavcodec/w32thread.c
@@ -20,6 +20,7 @@
 //#define DEBUG
 
 #include "avcodec.h"
+#include "thread.h"
 
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>