[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem with: #include <X11/Xlib.h>



gustavo halperin wrote:

> I have a code that include the file "/usr/include/X11/Xlib.h", but when I try to compile I receive the parser error, see below:
> In file included from cube.cpp:32:
> /usr/include/X11/Xlib.h: In function `char* XSetOMValues(_XOM*, ...)':
> /usr/include/X11/Xlib.h:3578: error: parse error before `(' token
> /usr/include/X11/Xlib.h: In function `char* XGetOMValues(_XOM*, ...)':
> /usr/include/X11/Xlib.h:3583: error: parse error before `(' token
> ..............
> 
> How I can resolve this problem,

I assume that you are using the Xlib.h from the Sid or Etch libx11-dev
package, since it has definitions for the functions XSetOMValues() and
XGetOMValues() near the line numbers printed in the compiler error.
(When reporting error messages in the future, please specify whether you
are using Sarge, Etch or Sid.)

It looks to me like the compiler is complaining about the _X_SENTINEL(0)
in this code in Xlib.h:

extern char *XSetOMValues(
    XOM                 /* om */,
    ...
) _X_SENTINEL(0);                  // <--- Line 3578

extern char *XGetOMValues(
    XOM                 /* om */,
    ...
) _X_SENTINEL(0);                  // <--- Line 3583


The _X_SENTINEL macro is defined in /usr/include/X11/Xfuncproto.h -- try
installing the latest version of the x11proto-core-dev package that
supplies this file.  (Should be version 7.0.4-3 in Sid or Etch.)

Here is another possibility if the above suggestion doesn't work.  The
definition of _X_SENTINEL includes the GNU C extension of the
"__sentinel__" attribute, but only when __GNUC__ is defined and >= 4.
Is it possible that you are using an older compiler that doesn't
recognize __sentinel__, but for some reason your build has defined
__GNUC__ to have a value of 4 or greater anyway?

Let the list know if these suggestions don't help.  It might also be
helpful if you posted the problematic file "cube.cpp".

regards,

-- 
Kevin B. McCarty <kmccarty@princeton.edu>   Physics Department
WWW: http://www.princeton.edu/~kmccarty/    Princeton University
GPG: public key ID 4F83C751                 Princeton, NJ 08544



Reply to: