Bogus error messages re Perl/lib/CORE/ includes
am 30.09.2005 13:36:08 von Sisyphus
Hi,
Every now and then I get errors like the following when trying to compile a
perl extension (perl 5.8, Win32):
f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2143: syntax error : missing
')' before '*'
f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2081: 'Stat_t' : name in
formal parameter list illegal
f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2143: syntax error : missing
'{' before '*'
f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2059: syntax error : ')'
f:\perlvc7\5.8.7\lib\CORE\win32.h(411) : error C2143: syntax error : missing
')' before '*'
f:\perlvc7\5.8.7\lib\CORE\win32.h(411) : error C2143: syntax error : missing
'{' before '*'
..
..
and lots more similar (in relation to perlio.h and win32iop.h as well).
Now I know there's nothing wrong with those particular files because they
get included every time I build an extension - and mostly the extensions
build fine.
Can someone tell me how these bogus error messages arise, and how to deal
with them ?
I recall seeing a post somewhere suggesting it was caused by #including a
header file more than once - though I don't understand how that can lead to
syntax errors. In this particular instance tonight I've tried to ensure that
multiple inclusion does not occur - but to no avail. Perhaps I've failed to
avoid multiple inclusion .... or perhaps the problem is caused by something
altogether different ?
Any help appreciated.
Cheers,
Rob
--
To reply by email send to optusnet.com.au instead of nomail.afraid.org
Re: Bogus error messages re Perl/lib/CORE/ includes
am 01.10.2005 10:45:31 von Ilya Zakharevich
[A complimentary Cc of this posting was sent to
Sisyphus
], who wrote in article <433d2367$0$20355$afc38c87@news.optusnet.com.au>:
> f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2143: syntax error : missing
> ')' before '*'
> f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2081: 'Stat_t' : name in
> formal parameter list illegal
> f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2143: syntax error : missing
> '{' before '*'
Probably an include inserted before them redefined something. With
gcc, you would give
-dD -E
switches, and inspect the resulting listing. Other compilers should
have similar switches...
Hope this helps,
Ilya
Re: Bogus error messages re Perl/lib/CORE/ includes
am 01.10.2005 13:30:06 von Sisyphus
----- Original Message -----
From: "Ilya Zakharevich"
Newsgroups: comp.lang.perl.modules
Sent: Saturday, October 01, 2005 6:45 PM
Subject: Re: Bogus error messages re Perl/lib/CORE/ includes
> [A complimentary Cc of this posting was sent to
> Sisyphus
> ], who wrote in article
<433d2367$0$20355$afc38c87@news.optusnet.com.au>:
>
> > f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2143: syntax error :
missing
> > ')' before '*'
> > f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2081: 'Stat_t' : name in
> > formal parameter list illegal
> > f:\perlvc7\5.8.7\lib\CORE\win32.h(312) : error C2143: syntax error :
missing
> > '{' before '*'
>
> Probably an include inserted before them redefined something.
Now *that* makes sense ..... so I've spent an hour or so trying to find out
what could have been re-defined, but failed to find anything. Then I noticed
in the output of nmake:
cl : Command line warning D4002 : ignoring unknown option '-g'
That was caused by the following in the (Writemakefile section of the)
Makefile.PL:
'CCFLAGS' => "$define_bool -g",
When I commented out that line in the Makefile.PL the problem disappeared.
Apparently, in this instance, it was the corruption of CCFLAGS that was
screwing things up.
Thanks, Ilya, for heading me in the right direction.
Cheers,
Rob