How stupid I am! Thanks. And I'll avoid using 'main' as function name. It's very kind of you.
On Fri, Mar 26, 2010 at 12:07 PM, Sisyphus <sisyph...@optusnet.com.au> wrote: > > ----- Original Message ----- From: "Xiao Yafeng" <xyf.x...@gmail.com> > To: "inline" <inline@perl.org>; "Sisyphus" <sisyph...@optusnet.com.au> > Sent: Friday, March 26, 2010 1:56 PM > Subject: inline can't see \n > > >> use Inline C =><<C_CODE; >> >> int main(){ >> printf("hello world!!!\n"); >> } >> C_CODE >> >> main(); >> >> show_pl_2930.xs: In function `main': >> show_pl_2930.xs:7: error: missing terminating " character >> show_pl_2930.xs:8: error: missing terminating " character >> show_pl_2930.xs:9: error: syntax error before '}' token >> dmake: Error code 129, while making 'show_pl_2930.o' > > The error messages are confusing. The real problem is that you have written: > > use Inline C =><<C_CODE; > > but it needs to be: > > use Inline C =><<'C_CODE'; > > If you fix that it should be ok on windows. (The closing C_CODE must *not* > be quoted ... just the opening C_CODE.) > > Probably not a good idea to be calling the function 'main' as that has > special significance in C - and, in fact, on some (maybe even all) unix-type > systems that script would not compile unless you change the name of the > function to something else. > > Cheers, > Rob > > >