概述
在安装perl的mysql module时,遇到如下问题:
install_driver(mysql) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/i686-linux/auto/DBD/mysql/mysql.so' for module DBD::mysql: /usr/lib/perl5/site_perl/5.8.8/i686-linux/auto/DBD/mysql/mysql.so: undefined symbol: __pure_virtual at /usr/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 230.
at (eval 5) line 3
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
at - line 36
解决方法:
1. 安装一个mysql
2. 设置以下变量:
export DBD_MYSQL_CFLAGS=-I<mysql_install_dir>/include/mysql
export DBD_MYSQL_LIBS="-L<mysql_install_dir>/lib/mysql -lmysqlclient"
export DBD_MYSQL_EMBEDDED=
export DBD_MYSQL_CONFIG=mysql_config
export DBD_MYSQL_NOCATCHSTDERR=0
export DBD_MYSQL_NOFOUNDROWS=0
export DBD_MYSQL_SSL=
export DBD_MYSQL_TESTDB=test
export DBD_MYSQL_TESTHOST=<mysql host>
export DBD_MYSQL_TESTPASSWORD=<mysql user password>
export DBD_MYSQL_TESTPORT=<mysql server port>
export DBD_MYSQL_TESTUSER=<mysql user>
3. 找到<mysql_install_dir>/bin/mysql_config,修改如下行:
libs=" $ldflags -L$pkglibdir -lmysqlclient -lz -lcrypt -lnsl -lm " 改成 libs=" $ldflags -L$pkglibdir -lmysqlclient -lz -lcrypt -lnsl -lm -lmygcc "
最后
以上就是冷酷钢笔为你收集整理的如何解决perl mysql module安装时的问题: undefined symbol的全部内容,希望文章能够帮你解决如何解决perl mysql module安装时的问题: undefined symbol所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复