diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 1b13c5686e01e472ae4f360c88ed7fde131b9268..4ab7086677975c81024a29df6e37f15f5011ce7b 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include "network.h"
 #include "os_support.h"
+#include <sys/select.h>
 #include <sys/time.h>
 
 typedef struct TCPContext {