【发布时间】:2011-10-08 14:02:33
【问题描述】:
我在使用标题中提到的配置时遇到了这个构建问题。我正在尝试构建的 Perl 模块是 MongoDB::Connection。我正在通过 CPAN shell 构建,或者像这样手动构建:
C:\Opt\Perl512.32\bin\perl.exe Makefile.PL
nmake
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
以下是错误代码及其频率:
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
在我看来,所有这些错误都是预处理阶段失败的症状。
这里就不贴整个输出了,开头是:
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
因此,鉴于Stat_t 的线索,我试图追查问题。
ack Stat_t c:\opt\perl512.32\lib\core\
所以Stat_t 在CORE\dosish.h 和CORE\unixish.h 中定义。两者都有条件地包含在CORE\perl.h 中。这包含在我要编译的文件中。所以它应该工作。
- 我可以做些什么来追踪问题?
- 导致此故障的原因是什么?
网上也有一些类似的错误。这里有一个谷歌搜索你:
http://www.google.com?q=perl+win32.h+c2059+c2143+c2081+c2371
谢谢。
【问题讨论】:
标签: windows perl visual-c++ mongodb build