I ran into this build problem using the configuration indicated in the header. The Perl module I'm trying to create is MongoDB::Connection . I build through the CPAN shell or manually:
C:\Opt\Perl512.32\bin\perl.exe Makefile.PL nmake
Command line for cl.exe :
cl -c -I. -MD -Zi -DNDEBUG -DVERSION=\"0.43\" -DXS_VERSION=\"0.43\" ^ /Foxs/BSON.obj "-IC:\Opt\Perl512.32\lib\CORE" xs\BSON.c
Here are the error codes and their frequencies:
6 C2040 'operator' : 'identifier1' differs in levels of indirection from 'identifier2' 32 C2059 syntax error : 'token' 7 C2081 'identifier' : name in formal parameter list illegal 54 C2143 syntax error : missing 'token1' before 'token2' 2 C2371 'identifier' : redefinition; different basic types
It seems to me that all these errors are symptoms of failure at the pre-processing stage.
Here I will not insert all the output, but the beginning:
c:\opt\perl512.32\lib\core\win32.h(368) : error C2143: Syntaxfehler: Es fehlt ')' vor '*' c:\opt\perl512.32\lib\core\win32.h(368) : error C2081: 'Stat_t': Name in der formalen Parameterliste ist ungültig c:\opt\perl512.32\lib\core\win32.h(368) : error C2143: Syntaxfehler: Es fehlt '{' vor '*' c:\opt\perl512.32\lib\core\win32.h(368) : error C2059: Syntaxfehler: ')' c:\opt\perl512.32\lib\core\win32.h(369) : error C2143: Syntaxfehler: Es fehlt ')' vor '*' c:\opt\perl512.32\lib\core\win32.h(369) : error C2081: 'STRLEN': Name in der formalen Parameterliste ist ungültig
So, given the hint of Stat_t , I tried to track down the problem.
ack Stat_t c:\opt\perl512.32\lib\core\
So, Stat_t defined in CORE\dosish.h and CORE\unixish.h . Both are conditionally included from CORE\perl.h This is included in the file I'm trying to compile. Therefore, it should work.
- What can I do to track the problem?
- What causes this failure?
There are some similar errors on the net. Here's a Google search for you:
http://www.google.com?q=perl+win32.h+c2059+c2143+c2081+c2371
Thanks.