有时候需要export LD_LIBRARY_PATH=/path/to/mysql/lib 2009/11/12 宇捷 <[email protected]>
> > 先装mysql-devel。 > > -----邮件原件----- > 发件人: > grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163....@googlegroups.com > [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com > @googlegroups > .com] 代表 Felix New > 发送时间: 2009年11月11日 23:23 > 收件人: [email protected] > 主题: [PerlChina] 安装DBI, DBD::mysql, make的时候报错 > > > 在linux上安装cpan模块很顺利的, 这2天想在mac(snow leopard)弄个环境, DBI和 > DBD::mysal死活都搞不定. > > > > 首先是编译DBI的时候, 到DBI.xs的时候是一堆警告, 但没有退出; > > 而编译DBD::mysql的时候, 在dbdimp.c和DBD.xs的时候, 又是一堆警告. > > 虽然2个模块最后都可以make install, 但DBD::mysql最后安装的是不可用的. > > > 问了下狗狗, 也没找到很好的答案, 大家遇到这样的出错么? 如果我缺少了什么东西, > 还希望大家指点, 少走弯路. (Xcode是装了的, 系统光盘带的版本) > > > > > > bash-3.2$ perl Makefile.PL > > *** You are using a perl configured with threading enabled. > *** You should be aware that using multiple threads is > *** not recommended for production environments. > > Your perl was compiled with gcc (version 4.2.1 (Apple Inc. build 5646)), > okay. > Creating test wrappers for DBI::PurePerl: > t/zvp_01basics.t > t/zvp_02dbidrv.t > t/zvp_03handle.t > t/zvp_04mods.t > t/zvp_05concathash.t > t/zvp_06attrs.t > ******** > ******** > t/zvxgp_80proxy.t > t/zvxgp_85gofer.t > t/zvxgp_86gofer_fail.t > t/zvxgp_87gofer_cache.t > Checking if your kit is complete... > Looks good > > I see you're using perl 5.010000 on darwin-thread-multi-2level, okay. > Remember to actually *read* the README file! > Use 'make' to build the software (dmake or nmake on Windows). > Then 'make test' to execute self tests. > Then 'make install' to install the DBI and then delete this working > directory before unpacking and building any DBD::* drivers. > > Writing Makefile for DBI > bash-3.2$ make > /usr/bin/perl "-MExtUtils::Command" -e mkpath blib/lib/DBI > rm -f blib/lib/DBI/Changes.pm > cp Changes blib/lib/DBI/Changes.pm > /usr/bin/perl "-MExtUtils::Command" -e mkpath blib/lib/DBI > rm -f blib/lib/DBI/Roadmap.pm > cp Roadmap.pod blib/lib/DBI/Roadmap.pm > cp Driver_xst.h blib/arch/auto/DBI/Driver_xst.h > cp lib/DBD/Proxy.pm blib/lib/DBD/Proxy.pm > cp lib/DBI/Gofer/Response.pm blib/lib/DBI/Gofer/Response.pm > cp lib/DBI/Gofer/Transport/Base.pm blib/lib/DBI/Gofer/Transport/Base.pm > cp lib/DBI/Util/_accessor.pm blib/lib/DBI/Util/_accessor.pm > cp lib/DBD/DBM.pm blib/lib/DBD/DBM.pm > cp DBIXS.h blib/arch/auto/DBI/DBIXS.h > cp Roadmap.pod blib/lib/Roadmap.pod > ************ > ************ > cp lib/DBI/ProfileData.pm blib/lib/DBI/ProfileData.pm > /usr/bin/perl -p -e "s/~DRIVER~/Perl/g" ./Driver.xst > Perl.xsi > /usr/bin/perl /System/Library/Perl/5.10.0/ExtUtils/xsubpp -typemap > /System/Library/Perl/5.10.0/ExtUtils/typemap -typemap typemap Perl.xs > > Perl.xsc && mv Perl.xsc Perl.c > gcc-4.2 -c -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common > -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -Os > -DVERSION=\"1. > 609\" -DXS_VERSION=\"1.609\" > "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" -W -Wall > -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare > -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter Perl.c > /usr/bin/perl /System/Library/Perl/5.10.0/ExtUtils/xsubpp -typemap > /System/Library/Perl/5.10.0/ExtUtils/typemap -typemap typemap DBI.xs > > DBI. > xsc && mv DBI.xsc DBI.c > gcc-4.2 -c -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common > -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -Os > -DVERSION=\"1. > 609\" -DXS_VERSION=\"1.609\" > "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" -W -Wall > -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare > -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter DBI.c > DBI.xs: In function '_sort_hash_keys': > DBI.xs:260: warning: format not a string literal and no format arguments > DBI.xs:261: warning: format not a string literal and no format arguments > DBI.xs: In function 'set_err_sv': > DBI.xs:623: warning: value computed is not used > DBI.xs: In function 'dbih_setup_handle': > DBI.xs:1289: warning: value computed is not used > DBI.xs:1290: warning: value computed is not used > DBI.xs:1295: warning: value computed is not used > DBI.xs:1298: warning: value computed is not used > DBI.xs: In function 'dbih_set_attr_k': > DBI.xs:1926: warning: value computed is not used > DBI.xs: In function 'dbih_get_attr_k': > DBI.xs:2017: warning: value computed is not used > DBI.xs:2241: warning: value computed is not used > DBI.xs: In function '_profile_next_node': > DBI.xs:2447: warning: value computed is not used > DBI.xs: In function 'XS_DBI_dispatch': > DBI.xs:3000: warning: value computed is not used > DBI.xs:3075: warning: value computed is not used > DBI.xs: In function 'XS_DBI__new_handle': > DBI.xs:4092: warning: value computed is not used > DBI.xs: In function 'XS_DBD_____st_fetchrow_hashref': > DBI.xs:4801: warning: value computed is not used > DBI.xs: In function '_sort_hash_keys': > DBI.xs:260: warning: format not a string literal and no format arguments > DBI.xs:261: warning: format not a string literal and no format arguments > DBI.xs: In function 'set_err_sv': > DBI.xs:623: warning: value computed is not used > DBI.xs: In function 'dbih_setup_handle': > DBI.xs:1289: warning: value computed is not used > *********** > BI.xs: In function 'XS_DBD_____st_fetchrow_hashref': > DBI.xs:4801: warning: value computed is not used > Running Mkbootstrap for DBI () > chmod 644 DBI.bs > rm -f blib/arch/auto/DBI/DBI.bundle > gcc-4.2 -mmacosx-version-min=10.6 -arch x86_64 -arch i386 -arch ppc > -bundle > -undefined dynamic_lookup -L/usr/local/lib DBI.o -o > blib/arch/auto/DBI/DBI. > bundle \ > \ > > chmod 755 blib/arch/auto/DBI/DBI.bundle > cp DBI.bs blib/arch/auto/DBI/DBI.bs > chmod 644 blib/arch/auto/DBI/DBI.bs > /usr/bin/perl "-Iblib/arch" "-Iblib/lib" dbiprof.PL dbiprof > Extracted dbiprof from dbiprof.PL with variable substitutions. > dbiprof syntax OK > cp dbiprof blib/script/dbiprof > > > > > > > > > bash-3.2$ perl Makefile.PL > > > PLEASE NOTE: > > For 'make test' to run properly, you must ensure that the > database user 'moxnet' can connect to your MySQL server > and has the proper privileges that these tests require such > as 'drop table', 'create table', 'drop procedure', 'create procedure' > as well as others. > > mysql> grant all privileges on test.* to 'moxnet'@'localhost' identified > by > 's3kr1t'; > > You can also optionally set the user to run 'make test' with: > > perl Makefile.pl --testuser=username > > I will use the following settings for compiling and testing: > > cflags (mysql_config) = -I/usr/local/mysql/include -g -Os -arch > i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE > -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT > -DDONT_DECLARE_CXA_PURE_VIRTUAL > embedded (mysql_config) = > libs (mysql_config) = -L/usr/local/mysql/lib -lmysqlclient -lz > -lm -lmygcc > mysql_config (guessed ) = mysql_config > nocatchstderr (default ) = 0 > nofoundrows (default ) = 0 > ssl (guessed ) = 0 > testdb (default ) = test > testhost (default ) = > testpassword (default ) = > testsocket (default ) = > testuser (guessed ) = moxnet > > To change these settings, see 'perl Makefile.PL --help' and > 'perldoc INSTALL'. > > Checking if your kit is complete... > Looks good > Using DBI 1.609 (for perl 5.010000 on darwin-thread-multi-2level) installed > in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ > Writing Makefile for DBD::mysql > bash-3.2$ make > 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 > gcc-4.2 -c -I/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI > -I/usr/local/mysql/include -g -Os -arch i386 -fno-common > -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ > -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL > -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -arch ppc -g > -pipe > -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -Os > -DVERSION=\"4.013\" -DXS_VERSION=\"4.013\" > "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" dbdimp.c > dbdimp.c: In function 'alloc_param': > dbdimp.c:113: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_bind': > dbdimp.c:131: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_fbind': > dbdimp.c:147: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_fbuffer': > dbdimp.c:162: warning: format not a string literal and no format arguments > dbdimp.c: In function 'parse_params': > dbdimp.c:477: warning: format not a string literal and no format arguments > dbdimp.c: In function 'my_login': > dbdimp.c:1796: warning: format not a string literal and no format arguments > dbdimp.c: In function 'mysql_st_internal_execute41': > dbdimp.c:3085: warning: format '%d' expects type 'int', but argument 3 has > type 'my_ulonglong' > dbdimp.c: In function 'mysql_describe': > dbdimp.c:3305: warning: format '%d' expects type 'int', but argument 5 has > type 'long unsigned int' > dbdimp.c:3309: warning: format '%d' expects type 'int', but argument 3 has > type 'long unsigned int' > dbdimp.c:3319: warning: assignment from incompatible pointer type > dbdimp.c:3320: warning: format not a string literal and no format arguments > dbdimp.c: In function 'mysql_st_fetch': > dbdimp.c:3504: warning: format not a string literal and no format arguments > dbdimp.c:3526: warning: format '%d' expects type 'int', but argument 3 has > type 'long int' > dbdimp.c:3568: warning: format '%08lx' expects type 'long unsigned int', > but > argument 3 has type 'struct MYSQL_RES *' > dbdimp.c:3570: warning: format '%llu' expects type 'long long unsigned > int', > but argument 3 has type 'unsigned int' > dbdimp.c: In function 'mysql_st_FETCH_attrib': > dbdimp.c:4153: warning: format '%d' expects type 'int', but argument 3 has > type 'my_ulonglong' > dbdimp.c: In function 'mysql_bind_ph': > dbdimp.c:4335: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > dbdimp.c:4353: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > dbdimp.c:4380: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > dbdimp.c: In function 'alloc_param': > dbdimp.c:113: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_bind': > dbdimp.c:131: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_fbind': > dbdimp.c:147: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_fbuffer': > dbdimp.c:162: warning: format not a string literal and no format arguments > dbdimp.c: In function 'parse_params': > dbdimp.c:477: warning: format not a string literal and no format arguments > dbdimp.c: In function 'my_login': > dbdimp.c:1796: warning: format not a string literal and no format arguments > dbdimp.c: In function 'mysql_st_internal_execute41': > dbdimp.c:3085: warning: format '%d' expects type 'int', but argument 3 has > type 'my_ulonglong' > dbdimp.c: In function 'mysql_describe': > dbdimp.c:3305: warning: format '%d' expects type 'int', but argument 5 has > type 'long unsigned int' > dbdimp.c:3309: warning: format '%d' expects type 'int', but argument 3 has > type 'long unsigned int' > dbdimp.c:3319: warning: assignment from incompatible pointer type > dbdimp.c:3320: warning: format not a string literal and no format arguments > dbdimp.c: In function 'mysql_st_fetch': > dbdimp.c:3504: warning: format not a string literal and no format arguments > dbdimp.c:3526: warning: format '%d' expects type 'int', but argument 3 has > type 'long int' > dbdimp.c:3568: warning: format '%08lx' expects type 'long unsigned int', > but > argument 3 has type 'struct MYSQL_RES *' > dbdimp.c:3570: warning: format '%llu' expects type 'long long unsigned > int', > but argument 3 has type 'unsigned int' > dbdimp.c: In function 'mysql_st_FETCH_attrib': > dbdimp.c:4153: warning: format '%d' expects type 'int', but argument 3 has > type 'my_ulonglong' > dbdimp.c: In function 'mysql_bind_ph': > dbdimp.c:4335: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > dbdimp.c:4353: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > dbdimp.c:4380: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > dbdimp.c: In function 'alloc_param': > dbdimp.c:113: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_bind': > dbdimp.c:131: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_fbind': > dbdimp.c:147: warning: format not a string literal and no format arguments > dbdimp.c: In function 'alloc_fbuffer': > dbdimp.c:162: warning: format not a string literal and no format arguments > dbdimp.c: In function 'parse_params': > dbdimp.c:477: warning: format not a string literal and no format arguments > dbdimp.c: In function 'my_login': > dbdimp.c:1796: warning: format not a string literal and no format arguments > dbdimp.c: In function 'mysql_st_internal_execute41': > dbdimp.c:3085: warning: format '%d' expects type 'int', but argument 3 has > type 'my_ulonglong' > dbdimp.c: In function 'mysql_describe': > dbdimp.c:3305: warning: format '%d' expects type 'int', but argument 5 has > type 'long unsigned int' > dbdimp.c:3309: warning: format '%d' expects type 'int', but argument 3 has > type 'long unsigned int' > dbdimp.c:3319: warning: assignment from incompatible pointer type > dbdimp.c:3320: warning: format not a string literal and no format arguments > dbdimp.c: In function 'mysql_st_fetch': > dbdimp.c:3504: warning: format not a string literal and no format arguments > dbdimp.c:3526: warning: format '%d' expects type 'int', but argument 3 has > type 'long int' > dbdimp.c:3568: warning: format '%08lx' expects type 'long unsigned int', > but > argument 3 has type 'struct MYSQL_RES *' > dbdimp.c:3570: warning: format '%llu' expects type 'long long unsigned > int', > but argument 3 has type 'unsigned int' > dbdimp.c: In function 'mysql_st_FETCH_attrib': > dbdimp.c:4153: warning: format '%d' expects type 'int', but argument 3 has > type 'my_ulonglong' > dbdimp.c: In function 'mysql_bind_ph': > dbdimp.c:4335: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > dbdimp.c:4353: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > dbdimp.c:4380: warning: format '%d' expects type 'int', but argument 3 has > type 'IV' > /usr/bin/perl -p -e "s/~DRIVER~/mysql/g" > /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/Driver.xst > > mysql. > xsi > /usr/bin/perl /System/Library/Perl/5.10.0/ExtUtils/xsubpp -typemap > /System/Library/Perl/5.10.0/ExtUtils/typemap mysql.xs > mysql.xsc && mv > mysql.xsc mysql.c > Warning: duplicate function definition 'do' detected in mysql.xs, line 225 > Warning: duplicate function definition 'rows' detected in mysql.xs, line > 650 > gcc-4.2 -c -I/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI > -I/usr/local/mysql/include -g -Os -arch i386 -fno-common > -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ > -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL > -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -arch ppc -g > -pipe > -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -Os > -DVERSION=\"4.013\" -DXS_VERSION=\"4.013\" > "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" mysql.c > mysql.xs: In function 'XS_DBD__mysql__db_do': > mysql.xs:329: warning: format not a string literal and no format arguments > mysql.xs:330: warning: format not a string literal and no format arguments > mysql.xs:331: warning: format not a string literal and no format arguments > mysql.xs:490: warning: format not a string literal and no format arguments > mysql.xs: In function 'XS_DBD__mysql__GetInfo_dbd_mysql_get_info': > mysql.xs:741: warning: format '%i' expects type 'int', but argument 2 has > type 'struct SV *' > mysql.xs: In function 'XS_DBD__mysql__db_do': > mysql.xs:329: warning: format not a string literal and no format arguments > mysql.xs:330: warning: format not a string literal and no format arguments > mysql.xs:331: warning: format not a string literal and no format arguments > mysql.xs:490: warning: format not a string literal and no format arguments > mysql.xs: In function 'XS_DBD__mysql__GetInfo_dbd_mysql_get_info': > mysql.xs:741: warning: format '%i' expects type 'int', but argument 2 has > type 'struct SV *' > mysql.xs: In function 'XS_DBD__mysql__db_do': > mysql.xs:329: warning: format not a string literal and no format arguments > mysql.xs:330: warning: format not a string literal and no format arguments > mysql.xs:331: warning: format not a string literal and no format arguments > mysql.xs:490: warning: format not a string literal and no format arguments > mysql.xs: In function 'XS_DBD__mysql__GetInfo_dbd_mysql_get_info': > mysql.xs:741: warning: format '%i' expects type 'int', but argument 2 has > type 'struct SV *' > Running Mkbootstrap for DBD::mysql () > chmod 644 mysql.bs > rm -f blib/arch/auto/DBD/mysql/mysql.bundle > LD_RUN_PATH="/usr/local/mysql/lib" /usr/bin/perl myld gcc-4.2 > -mmacosx-version-min=10.6 -arch x86_64 -arch i386 -arch ppc -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 -lmygcc \ > > chmod 755 blib/arch/auto/DBD/mysql/mysql.bundle > cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs > chmod 644 blib/arch/auto/DBD/mysql/mysql.bs > Manifying blib/man3/DBD::mysql.3pm > Manifying blib/man3/DBD::mysql::INSTALL.3pm > Manifying blib/man3/Bundle::DBD::mysql.3pm > bash-3.2$ sudo make install > > > > > bash-3.2$ cat ~/t > #!/usr/bin/perl > > use strict; > use warnings; > > > use DBI; > > my $h = DBI->connect("dbi:mysql:test:localhost", 'root', '') > or die $DBI::errstr; > $h->disconnect; > bash-3.2$ perl ~/t > dyld: lazy symbol binding failed: Symbol not found: _mysql_init > Referenced from: > /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle > Expected in: flat namespace > > dyld: Symbol not found: _mysql_init > Referenced from: > /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle > Expected in: flat namespace > > Trace/BPT trap > bash-3.2$ > > > > > > > > > -- 如果觉得无聊,您不妨访问Google Reader消遣 http://www.google.com/reader/view 要尝试黑版本Google,请访问 http://www.google.com/custom?q=&sa=Search&client=pub-4021907304270164&forid=1&channel=7519554017&ie=UTF-8&oe=UTF-8&cof=GALT%3A%23FF9900%3BGL%3A1%3BDIV%3A%230033FF%3BVLC%3ACC9900%3BAH%3Acenter%3BBGC%3A000000%3BLBGC%3A000000%3BALC%3AFFFFFF%3BLC%3AFFFFFF%3BT%3ACCCCCC%3BGFNT%3A33CC00%3BGIMP%3A33CC00%3BFORID%3A1%3B&hl=en --~--~---------~--~----~------------~-------~--~----~ 您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。 要在此论坛发帖,请发电子邮件到 [email protected] 要退订此论坛,请发邮件至 [email protected] 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛 -~----------~----~----~----~------~----~------~--~---
