On Ubuntu 12.04, I was able to follow exactly the example here: http://perldoc.perl.org/perlxstut.html#EXAMPLE-4
except for adding -x to the h2xs invocation and not adding the foo stub to the .xs file manually, and all worked just fine. I'm a little confused that you say modern linux/gcc but appear to have perl 5.8.8. On Fri, Oct 28, 2011 at 7:40 AM, Dirk Koopman <d...@tobit.co.uk> wrote: > Has anyone managed to get h2xs -x to produce anything on a modern gcc / > linux combination? It seems to barf parsing the interstices of stdio.h etc > and, BTW, with totally useless error messages. > > I also notice that debian removed the package on 2008 on the grounds that > "nobody used it" (and it produced this error then). > > Expecting parenth after identifier in `struct _IO_FILE_plus _IO_2_1_stdin_; > extern struct _IO_FILE_plus _IO_2_1_stdout_; > extern struct _IO_FILE_plus _IO_2_1_stderr_; > # 364 "/usr/include/libio.h" 3 4 > typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t > __nbytes); > > typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, > size_t __n); > > typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); > typedef int __io_close_fn (void *__cookie); > typedef __io_read_fn cookie_read_function_t; > typedef __io_write_fn cookie_write_function_t; > typedef __io_seek_fn cookie_seek_function_t; > typedef __io_close_fn cookie_close_function_t; > > typedef struct > { > __io_read_fn *read; > __io_write_fn *write; > __io_seek_fn *seek; > __io_close_fn *close; > } _IO_cookie_io_functions_t; > typedef _IO_cookie_io_functions_t cookie_io_functions_t; > > struct _IO_cookie_file; > > extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int > __read_write, > void *__cookie, _IO_cookie_io_functions_t __fns)' > after `struct _IO_FILE_plus _IO_2_1_stdin_' at > /usr/local/share/perl/5.8.8/C/**Scan.pm line 729. > > >