Monday, March 27, 2006

 

wine compile errors (X_SENTINEL)

Remember I'm using Debian SID (unstable), apt-get.

The GCC error when compiling wine [0.9.10] using libx11-dev [6.9.0.dfsg.1-4]:
#: gcc -c -I. -I. -I../../include -I../../include -I/usr/X11R6/include -D__WINESRC__   -D_REENTRANT -fPIC -Wall -pipe -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wpointer-arith  -g -O2  -o bitblt.o bitblt.c
In file included from x11drv.h:30,
from bitblt.c:33:
/usr/X11R6/include/X11/Xlib.h:3583: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3583: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3583: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3596: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3596: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3596: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3609: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3609: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3609: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3614: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3614: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3614: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3846: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3846: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3846: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3850: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3850: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3850: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3862: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3862: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3862: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3890: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3890: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3890: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3894: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3894: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3894: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3934: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3934: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3934: warning: data definition has no type or storage class


The problem is the x11-dev package doesn't say ANYTHING about _X_SENTINEL. I think before GCC 4.0, GCC supplied the _X_SENTINEL variable. But since we're using 4.0 that doesn't include it, we have to add it ourselves.
The solution: (add this to the beginning of /usr/X11R6/include/X11/Xlib.h):
/* _X_SENTINEL BS */
#if defined(__GNUC__) && (__GNUC__ >= 4)
# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
#else
# define _X_SENTINEL(x)
# define _X_ATTRIBUTE_PRINTF(x,y)
#endif /* GNUC >= 4 */

Comments:
Thanks for the solution; in my case I was trying to compile firestarter when I got the error.
It works now.
-Michael
 
thanks alot, this is great. I tried to find a solution on the net for weeks!
 
hollaco,

Thanks a lot ... you deserver a chocolate .... :)
 
Post a Comment



<< Home

Archives

March 2006   April 2006  

This page is powered by Blogger. Isn't yours?