DBD::Pg编译错误(Windows10/草莓Perl)

DBD::Pg compilation error (Windows 10 / Strawberry Perl)

我正在尝试在我的 windows 10/Strawberry Perl 上安装 DBD::Pg (3.7.4) 模块,但编译失败

为此,我在 metacpan 上下载了模块并在 windows 终端中执行了以下命令:

perl Makefile.PL phrtsd_orig

回复:

Configuring DBD::Pg 3.7.4
PostgreSQL version: 90603 (default port: 5432)
POSTGRES_HOME: (not set)
POSTGRES_INCLUDE: C:/STRAWB~1/c/include
POSTGRES_LIB: C:/STRAWB~1/c/lib
OS: MSWin32
Multiple copies of Driver.xst found in: C:/Strawberry/perl/site/lib/auto/DBI/ C:/Strawberry/perl/vendor/lib/auto/DBI/ at Makefile.PL line 182.
Multiple copies of Driver.xst found in: C:/Strawberry/perl/site/lib/auto/DBI/ C:/Strawberry/perl/vendor/lib/auto/DBI/ at Makefile.PL line 285.
Using DBI 1.64 (for perl 5.026001 on MSWin32-x64-multi-thread) installed in C:/Strawberry/perl/site/lib/auto/DBI/
Generating a gmake-style Makefile
Writing Makefile for DBD::Pg
Writing MYMETA.yml and MYMETA.json

但是执行命令后问题就来了gmake。 回应:

Skip blib\lib/Bundle/DBD/Pg.pm (unchanged)
Skip blib\lib\DBD/Pg.pm (unchanged)
Running Mkbootstrap for Pg ()
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "Pg.bs"
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Pg.bs blib\arch\auto\DBD\Pg\Pg.bs 644
gcc -c  -I"C:/STRAWB~1/c/include" -IC:\Strawberry\perl\site\lib\auto\DBI -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -DPGLIBVERSION=90603 -DPGDEFPORT=5432 -s -O2   -DVERSION=\"3.7.4\" -DXS_VERSION=\"3.7.4\"  "-IC:\STRAWB~1\perl\lib\CORE"   Pg.c
gcc -c  -I"C:/STRAWB~1/c/include" -IC:\Strawberry\perl\site\lib\auto\DBI -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -DPGLIBVERSION=90603 -DPGDEFPORT=5432 -s -O2   -DVERSION=\"3.7.4\" -DXS_VERSION=\"3.7.4\"  "-IC:\STRAWB~1\perl\lib\CORE"   dbdimp.c
gcc -c  -I"C:/STRAWB~1/c/include" -IC:\Strawberry\perl\site\lib\auto\DBI -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -DPGLIBVERSION=90603 -DPGDEFPORT=5432 -s -O2   -DVERSION=\"3.7.4\" -DXS_VERSION=\"3.7.4\"  "-IC:\STRAWB~1\perl\lib\CORE"   quote.c
gcc -c  -I"C:/STRAWB~1/c/include" -IC:\Strawberry\perl\site\lib\auto\DBI -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -DPGLIBVERSION=90603 -DPGDEFPORT=5432 -s -O2   -DVERSION=\"3.7.4\" -DXS_VERSION=\"3.7.4\"  "-IC:\STRAWB~1\perl\lib\CORE"   types.c
g++ Pg.def -o blib\arch\auto\DBD\Pg\Pg.xs.dll -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" Pg.o dbdimp.o quote.o types.o   "C:\STRAWB~1\perl\lib\CORE\libperl526.a" "C:\STRAWB~1\c\lib\libpq.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libsecur32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-base
quote.o:quote.c:(.text+0x63d): undefined reference to `__imp__snprintf.constprop.4'
collect2.exe: error: ld returned 1 exit status
gmake: *** [Makefile:496: blib\arch\auto\DBD\Pg\Pg.xs.dll] Error 1

如果此信息有帮助,我安装了另外两个模块:

在此先感谢您的帮助!

我可以用 DBD-Pg-3.7.4 重现这个。 It is a known bug. The patch by kmx 对我有用。