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

发布于 2024-07-30 18:33:57 字数 4705 浏览 4 评论 0原文

首先,我想构建 DBD::mysql 包。 这一直失败,因为无论 make 导致什么结果,都无法加载 Symbol not find: _is_prefix 进行测试。 所以我认为 cpan 可能有点旧了。 我知道这是一个随机假设,但 cpan 确实告诉我安装最新的 Bundle::CPAN< /a>.

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

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

First I wanted to build the DBD::mysql package. That kept failing because whatever make resulted in could not be loaded for the tests with a Symbol not found: _is_prefix. So I assumed that cpan might be a tad old. I know it's a random assumption, but cpan did tell me to install the latest Bundle::CPAN.

Who's successfully installed either DBD::mysql or Bundle::CPAN on Mac OS X 10.5? Could you recommend any thing I could be doing differently?

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

Here's a log of the CPAN output for DBD::mysql:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

梦开始←不甜 2024-08-06 18:33:57

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

  1. MySQL 5.1 for Mac OS X x86_64DBD::mysql 不兼容(尚)。 安装 32 位 x86 版本,然后重试。 你会成功的。 我希望 Perl Makefile.pl 能在横幅中告诉您这一点。
  2. Bundle::CPAN 有问题,因为我没有以 root 身份安装。 为什么这使它报告循环引用而不是安装权限问题,我永远不会明白。

如果此信息已过时,请添加评论。

Okay, if you get these errors I now know the following:

  1. MySQL 5.1 for Mac OS X x86_64 is not compatible with DBD::mysql (yet). Install the 32-bit x86 version, and try again. You'll succeed. I wish the perl Makefile.pl would just tell you that in a banner.
  2. Bundle::CPAN had issues because I wasn't installing as root. Why that makes it report circular references instead of installation permission issues, I'll never understand.

Please add a comment if and when this became outdated information.

空‖城人不在 2024-08-06 18:33:57

安装 mysql 的(测试版)5.4.1 64 位版本(可从其开发人员网站获取)可以解决该问题。 在雪豹上进行了测试。

Installing the (beta) 5.4.1 64 bit version of mysql, available from their developer website, fixes the issue. Tested on Snow Leopard.

旧人哭 2024-08-06 18:33:57

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

Did you try installing Bundle::DBD::mysql?

痴意少年 2024-08-06 18:33:57

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

I haven't dealt with this problem, but I found that MacPorts cleaned up all my UNIX incompatibility problems. You might want to try that before enduring too much pain and suffering.

渡你暖光 2024-08-06 18:33:57

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

一些问题:

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

Where is it complaining about a circular dependency? It looks like you are trying to link to an incompatible version of the mysql libraries. The symbol it's looking for isn't in the library you loaded. I don't think this is a problem caused by CPAN.pm or the cpan script.

Some questions:

  • Who compiled perl? Is this Apple's perl?
  • Who compiled mysql? Is that your own version since it's in /usr/local?
  • Did you previously compile other versions? I start with a compile to ensure everything points to the right places.
我做我的改变 2024-08-06 18:33:57

在我的计算机上安装最新的 Beta 64 位版本的 Mysql 修复了问题。

Installing latest beta 64bit version of Mysql fixed problem on my computer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文