在编译Perl的DBD :: mysql时如何修复“未找到符号:_is_prefix”?

时间:2009-08-14 20:09:30

标签: mysql macos perl dbd osx-tiger

首先,我想构建DBD::mysql包。这仍然失败,因为无法为Symbol not found: _is_prefix的测试加载导致的任何结果。所以我认为cpan可能有点老了。我知道这是一个随机的假设,但cpan确实告诉我安装最新的Bundle::CPAN

谁在Mac OS X 10.5上成功安装了DBD::mysqlBundle::CPAN?你能推荐一些我可以做的不同的事情吗?

This is perl, v5.8.8 built for darwin-thread-multi-2level
(with 4 registered patches, see perl -V for more detail)
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.1.36,
for apple-darwin9.5.0 (i386) using readline 5.1

以下是DBD::mysql的CPAN输出日志:

Writing Makefile for DBD::mysql
cc -c  -I/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3   -DVERSION=\"4.012\" -DXS_VERSION=\"4.012\"  "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE"   dbdimp.c
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI/Driver.xst > mysql.xsi

Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
/usr/bin/perl /System/Library/Perl/5.8.8/ExtUtils/xsubpp  -typemap /System/Library/Perl/5.8.8/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 650
cc -c  -I/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3   -DVERSION=\"4.012\" -DXS_VERSION=\"4.012\"  "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE"   mysql.c
dbdimp.c: In function 'mysql_describe':
dbdimp.c:3309: warning: assignment from incompatible pointer type
dbdimp.c: In function 'mysql_describe':
dbdimp.c:3309: warning: assignment from incompatible pointer type
rm -f blib/arch/auto/DBD/mysql/mysql.bundle
LD_RUN_PATH="/usr/local/mysql/lib" /usr/bin/perl myld cc -mmacosx-version-min=10.5.7  -arch ppc -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.bundle    \
       -L/usr/local/mysql/lib -lmysqlclient -lz -lm     \

chmod 755 blib/arch/auto/DBD/mysql/mysql.bundle
Manifying blib/man3/DBD::mysql.3pm
Manifying blib/man3/DBD::mysql::INSTALL.3pm
Manifying blib/man3/Bundle::DBD::mysql.3pm
  CAPTTOFU/DBD-mysql-4.012.tar.gz
  /usr/bin/make -j3 -j3 -- OK

Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.t .................. 1/6 Bailout called.  Further testing stopped:  Unable to load DBD::mysql

#   Failed test 'use DBD::mysql;'
#   at t/00base.t line 21.
#     Tried to use 'DBD::mysql'.
#     Error:  Can't load '/Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Symbol not found: _is_prefix
#   Referenced from: /Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle
#   Expected in: dynamic lookup
#  at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
  CAPTTOFU/DBD-mysql-4.012.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports CAPTTOFU/DBD-mysql-4.012.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 CAPTTOFU/DBD-mysql-4.012.tar.gz              : make_test NO

6 个答案:

答案 0 :(得分:5)

好的,如果您收到这些错误,我现在知道以下内容:

  1. MySQL 5.1 for Mac OS X x86_64DBD::mysql(尚未)兼容。安装32位x86版本,然后重试。你会成功的。我希望perl Makefile.pl能在横幅中告诉你。
  2. Bundle::CPAN有问题,因为我没有以root身份安装。为什么这会使它报告循环引用而不是安装权限问题,我永远不会理解。
  3. 如果此信息成为过时信息,请添加评论。

答案 1 :(得分:2)

安装他们的开发者网站提供的(测试版)5.4.1 64位版本的mysql可以解决这个问题。在Snow Leopard上进行测试。

答案 2 :(得分:1)

您是否尝试安装Bundle::DBD::mysql

答案 3 :(得分:0)

我没有解决这个问题,但我发现MacPorts清理了所有UNIX不兼容问题。在忍受太多的痛苦和痛苦之前,你可能想尝试一下。

答案 4 :(得分:0)

它在哪里抱怨循环依赖?看起来您正在尝试链接到不兼容的mysql库版本。它正在寻找的符号不在您加载的库中。我不认为这是由CPAN.pm或cpan脚本引起的问题。

有些问题:

  • 谁编译了perl?这是Apple的perl吗?
  • 谁编译了mysql?这是你自己的版本,因为它在/ usr / local?
  • 您之前编译过其他版本吗?我从编译开始,以确保所有内容都指向正确的位置。

答案 5 :(得分:0)

在我的电脑上安装最新的beta 64位版本的Mysql修复问题。