[Xcb] compiling

Adam Majewski adammaj1 at o2.pl
Mon Jul 11 09:25:35 PDT 2011


Hi,

I try to compile example from page :
http://xcb.freedesktop.org/tutorial/events/

After :
 gcc -Wall e.c -lxcb
I get : 

e.c: In function ‘print_modifiers’:
e.c:17: warning: initialization from incompatible pointer type
e.c:17: error: ‘for’ loop initial declarations are only allowed in C99 
mode
e.c:17: note: use option -std=c99 or -std=gnu99 to compile your code
e.c:19: warning: format not a string literal and no format arguments
e.c: In function ‘main’:
e.c:32: error: ‘c’ undeclared (first use in this function)
e.c:32: error: (Each undeclared identifier is reported only once
e.c:32: error: for each function it appears in.)
e.c:57: error: ‘win’ undeclared (first use in this function)
e.c:62: warning: suggest parentheses around assignment used as truth value
e.c:65: error: a label can only be part of a statement and a declaration 
is not a statement
e.c:68: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has 
type ‘xcb_window_t’
e.c:72: error: a label can only be part of a statement and a declaration 
....
e.c:132: warning: format ‘%ld’ expects type ‘long int’, but argument 2 
has type ‘xcb_window_t’

Similar errors are after 

gcc -Wall e.c  `pkg-config --cflags --libs xcb`

I can compile and run example from wikipedia
http://en.wikipedia.org/wiki/Xcb

What should I do ?

Thx in advance

Adam



More information about the Xcb mailing list