无法安装perl CPAN模块POSIX :: strptime

我正尝试使用cpan命令在运行Strawberry Perl 5.24.1.1(64位)的Windows 10系统上安装perl模块POSIX::strptime ,但无法构build和安装。 我正在使用的命令是:

 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 

有人能帮我解决这个问题吗?

谢谢,Matt

在你的日志中,关键的错误是:

strptime.o:strptime.c:(.text+0x121): undefined reference to 'strptime'

Windows上没有任何链接可以使用。 因此,该模块没有在Windows上建立的机会。 Makefile.PL应该测试一下,然后释放。

正如已经指出的, DateTime :: Format :: Strptime可能是一个合适的替代品。 时间:: Strptime和时间:: Piece-> strptime是其他的选择。