【问题标题】:Building Perl/C module using Microsoft VC (cl.exe) 2010 (10.0) Express and ActivePerl 5.12.4/32使用 Microsoft VC (cl.exe) 2010 (10.0) Express 和 ActivePerl 5.12.4/32 构建 Perl/C 模块
【发布时间】: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_tCORE\dosish.hCORE\unixish.h 中定义。两者都有条件地包含在CORE\perl.h 中。这包含在我要编译的文件中。所以它应该工作。

  • 我可以做些什么来追踪问题?
  • 导致此故障的原因是什么?

网上也有一些类似的错误。这里有一个谷歌搜索你:

http://www.google.com?q=perl+win32.h+c2059+c2143+c2081+c2371

谢谢。

【问题讨论】:

    标签: windows perl visual-c++ mongodb build


    【解决方案1】:

    这看起来像一个错误报告。 也许值得发送到 CPAN 错误跟踪器? https://rt.cpan.org/Public/Dist/Display.html?Name=MongoDB

    【讨论】:

    • 如果是bug,那么我认为它不在MongoDB模块中。
    猜你喜欢
    • 1970-01-01
    • 2023-03-24
    • 2016-07-22
    • 2011-09-20
    • 1970-01-01
    • 2013-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多