From: "Iñaki Baz Castillo" Date: 2009-10-12T22:39:58+09:00 Subject: Re: Does ruby.h overrides C "enum"? El Lunes, 12 de Octubre de 2009, 7stud -- escribió: > Iñaki Baz Castillo wrote: > > Hi, writting a Ruby C extension (for 1.8 or 1.9) I get an error when > > using > > "enum": > > > > #include "ruby.h" > > int void(void) { > > enum kk {ONE, TWO, THREE}; // line 3 > > } > > > > line 3: error: expected identifier before ‘(’ token > > > > > > It doesn't occur if I quit "ruby.h". What is happening? > > What does "quit ruby.h mean"? I just mean that the above code (note that it should be "int main(void)") without '#include "ruby.h"' line compiles ok. > What compiler are you using? gcc 4.3 under Debian Lenny 64 bits. > test.c : > ----- > int void(void) { > enum kk {ONE, TWO, THREE}; // line 3 > } > > > --output:-- > $ g++ test.c -o test > test.c:1: error: expected unqualified-id before ‘void’ Yes, a typo of my mail. Please use "int main(void)" instead. -- Iñaki Baz Castillo