我試圖在運行Strawberry Perl 5.24.1.1(64位)的Windows 10系統上使用cpan命令安裝perl模塊POSIX::strptime
,但無法構建並安裝。我使用的命令是:無法安裝perl CPAN模塊POSIX :: strptime
cpan> install POSIX::strptime
,輸出是:
Running install for module 'POSIX::strptime'
Checksum for C:\STRAWB~1\cpan\sources\authors\id\G\GO\GOZER\POSIX-strptime-0.13.tar.gz ok
Configuring G/GO/GOZER/POSIX-strptime-0.13.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a dmake-style Makefile
Writing Makefile for POSIX::strptime
Writing MYMETA.yml and MYMETA.json
GOZER/POSIX-strptime-0.13.tar.gz
C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for G/GO/GOZER/POSIX-strptime-0.13.tar.gz
cp lib/POSIX/strptime.pm blib\lib\POSIX\strptime.pm
Running Mkbootstrap for strptime()
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "strptime.bs"
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- strptime.bs blib\arch\auto\POSIX\strptime\strptime.bs 644
"C:\Strawberry\perl\bin\perl.exe" "C:\Strawberry\perl\lib\ExtUtils\xsubpp" -typemap C:\STRAWB~1\perl\lib\ExtUtils\typemap strptime.xs > strptime.xsc
Please specify prototyping behavior for strptime.xs (see perlxs manual)
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- strptime.xsc strptime.c
gcc -c -I. -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"0.13\" -DXS_VERSION=\"0.13\" "-IC:\STRAWB~1\perl\lib\CORE" strptime.c
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \
-e "Mksymlists('NAME'=>\"POSIX::strptime\", 'DLBASE' => 'strptime', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);"
g++ strptime.def -o blib\arch\auto\POSIX\strptime\strptime.xs.dll -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" strptime.o "C:\STRAWB~1\perl\lib\CORE\libperl524.a" -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -Wl,--enable-auto-image-base
strptime.o:strptime.c:(.text+0x121): undefined reference to `strptime'
collect2.exe: error: ld returned 1 exit status
dmake.exe: Error code 129, while making 'blib\arch\auto\POSIX\strptime\strptime.xs.dll'
GOZER/POSIX-strptime-0.13.tar.gz
C:\STRAWB~1\c\bin\dmake.exe -- NOT OK
Stopping: 'install' failed for 'POSIX::strptime'.
Failed during this command:
GOZER/POSIX-strptime-0.13.tar.gz : make NO
有沒有人能夠幫我解決這個問題?
謝謝, 馬特
乍一看,幾乎所有的CPAN測試人員[失敗](http://www.cpantesters.org/distro/P/POSIX-strptime.html?oncpan=1&distmat=1&version=0.13&grade=3)都已打開視窗。換句話說,Win平臺沒有通過測試。不過我現在正在做一些快速測試。 – stevieb
經過粗略的審查之後,它看起來像是使用'time.h',它在Windows上找不到,這可能會破壞事情。如果是這樣的話,POD應該說明這一點,如果'$^O =〜/ Win32 /' – stevieb
[相關](http://stackoverflow.com/questions/),應該在'Makefile.PL'中檢查以停止構建。 321849/strptime-equivalent-on-windows) – ikegami