我一直在尝试在我的 Windows 7 (x86_64) PC 上安装 BerkeleyDB CPAN 模块,但没有任何运气(BerkeleyDB::Hash 是我需要的)。我安装了 64 位 ActivePerl 和 Oracle Berkeley DB 11gR2 5.3.15。首先我尝试使用命令安装:
*cpan install BerkeleyDB*
这又出现了错误:
*It looks like the installation of dmake and MinGW has failed. You will not be
able to run Makefile commands or compile C extension code. Please check your
internet connection and your proxy settings!*
所以我为 Windows 7 和 .NET Framework 4 安装了 Microsoft Windows SDK。
然后我安装了cpanm
*cpan App::cpanminus*
当我尝试运行时:
*cpanm BerkeleyDB*
我得到了错误:
*Note (probably harmless): No library found for -llibdb
Note (probably harmless): No library found for bufferoverflowU.lib*
所以我编辑了 config.in 文件并将 lib 和包含路径更改为:
*INCLUDE = C:\PROGRA~2\Oracle\BERKEL~1.15\include
LIB = C:\PROGRA~2\Oracle\BERKEL~1.15\lib*
现在,当我运行 perl makefile.pl 时,关于 -llibdb 的警告消失了。
当我尝试运行时:
*nmake*
我收到错误:
*Creating library blib\arch\auto\BerkeleyDB\BerkeleyDB.lib and object blib\arc
h\auto\BerkeleyDB\BerkeleyDB.exp
BerkeleyDB.obj : error LNK2001: unresolved external symbol __heap_exist
BerkeleyDB.obj : error LNK2001: unresolved external symbol db_version
BerkeleyDB.obj : error LNK2001: unresolved external symbol db_strerror
BerkeleyDB.obj : error LNK2001: unresolved external symbol db_env_create
BerkeleyDB.obj : error LNK2001: unresolved external symbol db_create
BerkeleyDB.obj : error LNK2001: unresolved external symbol db_sequence_create
blib\arch\auto\BerkeleyDB\BerkeleyDB.dll : fatal error LNK1120: 6 unresolved ext
ernals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\Bin\amd64\link.EXE"' : return code '0x460'
Stop.*
我几乎失去了在我的 PC 上成功构建这个模块的所有希望。有没有人对此感到幸运?
非常感谢,
序列号