![](/img/trans.png)
[英]Visual C++ 10.0 issue when installing Python module; cl.exe failed with exit status 2 (h5py)
[英]Building Perl/C module using Microsoft VC (cl.exe) 2010 (10.0) Express and ActivePerl 5.12.4/32
我使用標題中提到的配置面臨這個構建問題。 我正在嘗試構建的 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
在我看來,所有這些錯誤都是預處理階段失敗的症狀。
這里我就不貼整個output了,但是開頭是:
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
謝謝。
這看起來像一個錯誤報告。 也許值得發送到 CPAN 錯誤跟蹤器? https://rt.cpan.org/Public/Dist/Display.html?Name=MongoDB
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.