本人的虚拟机编译环境:VM11
系统:Description: Ubuntu 14.10 (附带说明一下是64位的)
编译SDL报错的日志如下:
./src/video/x11/SDL_x11sym.h:171:17: error: conflicting types for ‘_XData32’
SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
^
./src/video/x11/SDL_x11dyn.c:95:5: note: in definition of macro ‘SDL_X11_SYM’
rc fn params { ret p##fn args ; }
^
In file included from ./src/video/x11/SDL_x11dyn.h:34:0,
from ./src/video/x11/SDL_x11dyn.c:26:
/usr/include/X11/Xlibint.h:568:12: note: previous declaration of ‘_XData32’ was here
extern int _XData32(
^
build-deps:1154: recipe for target 'build/SDL_x11dyn.lo' failed
make: *** [build/SDL_x11dyn.lo] Error 1
有在网上查询DL的补丁方法:http://hg.libsdl.org/SDL/rev/91ad7b43317a
补丁如下,但是打上下面这个补丁还是编译不过啊,还是报跟之前一样的错误。
诚心求各位师傅指导?能绕过这个编译问题,可以生成ffplay就感激不进了。另外,本人完全是新手,大家有什么好的学习资料和学习方法,可以教我一下啊,谢谢了~
+++ b/configure.in Sun Jun 02 20:48:53 2013 +0600
@@ -1169,6 +1169,17 @@
if test x$definitely_enable_video_x11_xrandr = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
fi
+ AC_MSG_CHECKING(for const parameter to _XData32)
+ have_const_param_xdata32=no
+ AC_TRY_COMPILE([
+ #include <X11/Xlibint.h>
+ extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
+ ],[
+ ],[
+ have_const_param_xdata32=yes
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
+ ])
+ AC_MSG_RESULT($have_const_param_xdata32)
fi
fi
}
--- a/include/SDL_config.h.in Wed Apr 17 00:56:53 2013 -0700
+++ b/include/SDL_config.h.in Sun Jun 02 20:48:53 2013 +0600
@@ -283,6 +283,7 @@
#undef SDL_VIDEO_DRIVER_WINDIB
#undef SDL_VIDEO_DRIVER_WSCONS
#undef SDL_VIDEO_DRIVER_X11
+#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
--- a/src/video/x11/SDL_x11sym.h Wed Apr 17 00:56:53 2013 -0700
+++ b/src/video/x11/SDL_x11sym.h Sun Jun 02 20:48:53 2013 +0600
@@ -165,7 +165,11 @@
*/
#ifdef LONG64
SDL_X11_MODULE(IO_32BIT)
+#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
+SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
+#else
SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
+#endif
SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
#endif
2 个解决方案
#1
我在windows下用mingw+msys编译ffmpeg,自已编译sdl,也是问题多多,最后用sdl官方自己编译的版本,ok了。
#2
可以找个linux环境编译
#1
我在windows下用mingw+msys编译ffmpeg,自已编译sdl,也是问题多多,最后用sdl官方自己编译的版本,ok了。
#2
可以找个linux环境编译