在OSX 10.11上安装DBD::MySQL时出错-CAN链接/包含C库';';,正在中止
通过自制软件更新Perl后,我损坏了
dbd::mysql
安装
通过cpanm
安装会导致:
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/local/Cellar/mysql-connector-
c/6.1.9/include
embedded (guessed ) =
ldflags (guessed ) =
libs (mysql_config) = -L/usr/local/Cellar/mysql-connector-
c/6.1.9/lib -l
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
nossl (default ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) = root
To change these settings, see 'perl Makefile.PL --help' and 'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
Can't link/include C library '', aborting.
有人知道如何解决吗?
我已尝试删除mysql-connector-c
并安装mysql
VIA
改成自制的。那么投诉就是Can't link/include C library
'ssl', 'crypto', aborting
。我确实安装了openssl
。
Perl版本:
This is perl 5, version 24, subversion 1 (v5.24.1) built for
darwin-thread-multi-2level
解决方案
按
which mysql_config
显示mysql_config
路径例如:/usr/local/opt/mysql@5.7/bin/mysql_config
通过
which openssl
显示OpenSSL库路径。注意:如果它是/usr/local/bin/openssl
中的符号,您可以键入ls -ld /usr/local/bin/openssl
以显示实际路径例如:如果是
/usr/local/openssl/bin/openssl
, 然后您可以插入-L/usr/local/openssl/lib/
用于搜索crypto
和ssl
库编辑
mysql_config
文件并插入OpenSSL库的路径(第114行)例如:
libs=$libs -L/usr/local/opt/openssl/lib
4.键入
cpan install DBD::mysql
,成功。
相关文章