由于在Strawberry Perl上使用cpan进行了测试,因此DBD :: DB2安装失败 [英] DBD::DB2 installation failing because of test using cpan on Strawberry Perl
问题描述
我对perl还是很陌生,我正在尝试使用cpan在Windows PC上为perl安装DBD :: DB2模块,但是我一直收到此错误:
I am very new to perl and I am trying to install DBD::DB2 module for perl on a windows PC using cpan but I keep getting this error:
CPAN: CPAN::SQLite loaded ok (v0.212)
Database was generated on Thu, 06 Dec 2018 20:55:19 GMT
Running install for module 'DBD::DB2'
CPAN: Digest::SHA loaded ok (v6.02)
CPAN: Compress::Zlib loaded ok (v2.081)
Checksum for D:\STRAWB~1\cpan\sources\authors\id\I\IB\IBMTORDB2\DBD-DB2-1.85.tar.gz ok
CPAN: Archive::Tar loaded ok (v2.32)
CPAN: YAML::XS loaded ok (v0.75)
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
Configuring I/IB/IBMTORDB2/DBD-DB2-1.85.tar.gz with Makefile.PL
Configuring DBD::DB2...
Remember to actually read the README and CAVEATS files!
Using DB2 in "D:/SQLLIB"
System: perl5.028001 DBI1.642 Win32 strawberry-perl 5.28.1.1 #1 Sun Dec 2 14:24:00 2018 x64 MSWin32-x64-multi-thread dl_win32.xs
Compiler: gcc -s -O2 -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
Includes: -I"D:/SQLLIB/include" -I"D:\STRAWB~1\perl\site\lib/auto/DBI" -I"D:\STRAWB~1\perl\lib/auto/DBI" -I"D:\STRAWB~1\perl\vendor\lib/auto/DBI" -I"D:\STRAWB~1\perl\site\lib/auto/DBI"
Libraries: -L"D:/SQLLIB/lib" db2cli.lib db2api.lib
Checking if your kit is complete...
Looks good
Checking if your kit is complete...
Looks good
Writing MYMETA.yml and MYMETA.json
Generating a gmake-style Makefile
Writing Makefile for DBD::DB2
Writing MYMETA.yml and MYMETA.json
IBMTORDB2/DBD-DB2-1.85.tar.gz
D:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for I/IB/IBMTORDB2/DBD-DB2-1.85.tar.gz
CPAN: Module::CoreList loaded ok (v5.20181130)
cp DB2.pm blib\lib\DBD\DB2.pm
cp DB2.pod blib\lib\DBD\DB2.pod
cp lib/Bundle/DBD/DB2.pm blib\lib\Bundle\DBD\DB2.pm
gmake[1]: Entering directory 'D:/STRAWB~1/cpan/build/DBD-DB2-1.85-10/Constants'
AutoSplitting ..\blib\lib\DBD\DB2\Constants.pm (..\blib\lib\auto\DBD\DB2\Constants)
Running Mkbootstrap for Constants ()
"D:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "Constants.bs"
"D:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Constants.bs ..\blib\arch\auto\DBD\DB2\Constants\Constants.bs 644
"D:\Strawberry\perl\bin\perl.exe" "D:\Strawberry\perl\lib\ExtUtils/xsubpp" -typemap D:\STRAWB~1\perl\lib\ExtUtils\typemap Constants.xs > Constants.xsc
"D:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- Constants.xsc Constants.c
gcc -c -I"D:/SQLLIB/include" -I"D:\STRAWB~1\perl\site\lib/auto/DBI" -I"D:\STRAWB~1\perl\lib/auto/DBI" -I"D:\STRAWB~1\perl\vendor\lib/auto/DBI" -I"D:\STRAWB~1\perl\site\lib/auto/DBI" -I"D:/SQLLIB/include" -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 -s -O2 -DVERSION=\"1.85\" -DXS_VERSION=\"1.85\" "-ID:\STRAWB~1\perl\lib\CORE" - DDB2_CACHE_FIX Constants.c
gmake[1]: Leaving directory 'D:/STRAWB~1/cpan/build/DBD-DB2-1.85-10/Constants'
IBMTORDB2/DBD-DB2-1.85.tar.gz
D:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'DBD::DB2'.
我试图从另一台计算机上复制DBD :: DB2模块,但是那没有用,并给了我错误无法在@INC中找到模块DBD :: DB2 :: Constants的可加载对象感谢您的帮助.
I tried to copying the DBD::DB2 module form another computer but that did not work and gave me error Can't locate loadable object for module DBD::DB2::Constants in @INC Any help is appreciated.
推荐答案
我已经找到解决方法,只需将其插入以下文件即可:
I've found a work around for this, just insert this the following files:
- Constants/Constants.xs
- DB2.h
#ifndef __DBD_DBI_FIX__
#define __DBD_DBI_FIX__
#include <specstrings.h>
#ifndef __out_ecount_opt
#define __out_ecount_opt SAL__out_ecount_opt
#endif
#ifndef __in_ecount_opt
#define __in_ecount_opt SAL__in_ecount_opt
#endif
#ifndef __out_bcount_opt
#define __out_bcount_opt SAL__out_bcount_opt
#endif
#endif
完整修复程序在这里: https://github.com/ro-ag/DBD-DB2-1.86/commit/1ad9d4163656d9830fd567caf6d57603045ee392
The full fix is here: https://github.com/ro-ag/DBD-DB2-1.86/commit/1ad9d4163656d9830fd567caf6d57603045ee392
您也可以从我为Windows 10创建的PPM软件包中直接安装它: https://github.com/ro-ag/Perl-64-PPM/raw/master/PPM-64/DBD-DB2.tar.gz
You may also direct install it from a PPM package I've create for Windows 10: https://github.com/ro-ag/Perl-64-PPM/raw/master/PPM-64/DBD-DB2.tar.gz
我忘记了cpan模块,我已经向IBM发送了几封电子邮件以包含此修补程序,但没有成功.
The cpan module is forgotten i've sent several e-mails to IBM to include this fix without success.
这篇关于由于在Strawberry Perl上使用cpan进行了测试,因此DBD :: DB2安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!