diff --git a/ffmpeg.c b/ffmpeg.c
index 70372af455d39046a0fc3494703898559a07a178..7eed04f3b3ac6c95a89b43ec52ca0822ed0dc21e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -21,6 +21,7 @@
 #include "avformat.h"
 #include "framehook.h"
 #include "dsputil.h"
+#include "opt.h"
 
 #ifndef CONFIG_WIN32
 #include <unistd.h>
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 826329f8accda372473614efdffa7d77dd35beea..82a198453e95bfc4d2767cf4168059eea32e7abd 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -12,7 +12,6 @@ extern "C" {
 #endif
 
 #include "avutil.h"
-#include "opt.h"
 #include <sys/types.h> /* size_t */
 
 //FIXME the following 2 really dont belong in here
@@ -682,7 +681,7 @@ struct AVCLASS {
 					or AVFormatContext, which begin with an AVClass.
 					Needed because av_log is in libavcodec and has no visibility
 					of AVIn/OutputFormat */
-    AVOption *option;
+    struct AVOption *option;
 };
 
 /**
diff --git a/libavcodec/opt.c b/libavcodec/opt.c
index 80770549b965125e6dd3a50c72f596c8b2eda88f..8934c23d4e58d0f8b8afcb0c7759fe75579239a8 100644
--- a/libavcodec/opt.c
+++ b/libavcodec/opt.c
@@ -25,6 +25,7 @@
  */
  
 #include "avcodec.h"
+#include "opt.h"
  
 static double av_parse_num(const char *name, char **tail){
     double d;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 3eb1e60014340995215325b4701187ced58db622..8fc275bc6baf61017b1327c430e34cdc78f681d9 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -28,6 +28,7 @@
 #include "dsputil.h"
 #include "mpegvideo.h"
 #include "integer.h"
+#include "opt.h"
 #include <stdarg.h>
 #include <limits.h>
 #include <float.h>