[英]Using Ubuntu, how do I install DBD::Sybase from CPAN?
Whenever I try to build DBD::Sybase
to connect to MSSQL I get an error, 每当我尝试构建
DBD::Sybase
连接到MSSQL时,我都会收到错误,
$ sudo cpanp install DBD::Sybase
Installing DBD::Sybase (1.15)
Running [/usr/bin/perl /usr/bin/cpanp-run-perl /home/ecarroll/.cpanplus/5.14.2/build/DBD-Sybase-1.15/Makefile.PL INSTALLDIRS=site]...
Can't find any Sybase libraries in /etc/lib or /etc/lib64 at /home/ecarroll/.cpanplus/5.14.2/build/DBD-Sybase-1.15/Makefile.PL line 155, <IN> line 44.
BEGIN failed--compilation aborted at /usr/bin/cpanp-run-perl line 11, <IN> line 44.
[ERROR] Could not run '/usr/bin/perl Makefile.PL': Can't find any Sybase libraries in /etc/lib or /etc/lib64 at /home/ecarroll/.cpanplus/5.14.2/build/DBD-Sybase-1.15/Makefile.PL line 155, <IN> line 44.
BEGIN failed--compilation aborted at /usr/bin/cpanp-run-perl line 11, <IN> line 44.
-- cannot continue
[ERROR] Unable to create a new distribution object for 'DBD::Sybase' -- cannot continue
*** Install log written to:
/home/ecarroll/.cpanplus/install-logs/DBD-Sybase-1.15-1374605483.log
Error installing 'DBD::Sybase'
Problem installing one or more modules
I've also gotten this error on other Debian systems. 我在其他Debian系统上也遇到了这个错误。
There are two ways to do that, 有两种方法可以做到
The second option (b) is always possible, but then your system may have two different versions of freetds. 第二个选项(b)总是可行的,但是你的系统可能有两个不同版本的freetds。
The first option can not be done without some hacking and the author will not fix it. 如果没有一些黑客攻击,第一个选项就无法完成,作者也无法修复它。 He is simply hard headed and wants to fix internal structures to match the OS he uses rather than making it accepting of other configurations.
他只是头脑冷静,想要修复内部结构以匹配他使用的操作系统,而不是让它接受其他配置。
Internally DBD::Sybase
expects there to be a directory, and a $libdir
(a subdirectory with lib
or lib64
). 在内部
DBD::Sybase
期望有一个目录和$libdir
(带有lib
或lib64
的子目录)。 The directories DBD::Sybase
requires to build properly are not provided by the Debian package freetds-dev
; Debian软件包
freetds-dev
不提供DBD::Sybase
需要正确构建的目录; the Debian package installs to /usr/include
which doesn't have a lib
or a lib64
subdirectory. Debian软件包安装到
/usr/include
,它没有lib
或lib64
子目录。 You can get around this by fooling make
and recreating that structure, first make sure you have freetds-dev
installed, 您可以通过欺骗
make
并重新创建该结构来解决这个问题,首先确保安装了freetds-dev
,
sudo apt-get install freetds-dev
Then link it to create a pseudo-package. 然后链接它以创建一个伪包。 On my 64 bit machine, it looks something like this.
在我的64位机器上,它看起来像这样。
mkdir /tmp/freetds
ln -s /usr/lib/x86_64-linux-gnu/ /tmp/freetds/lib64
ln -s /usr/include /tmp/freetds/include/freetds
Now, it should work and you can build DBD::Sybase
against system libraries. 现在,它应该工作,您可以针对系统库构建
DBD::Sybase
。
sudo SYBASE=/tmp/freetds cpanp install DBD::Sybase
Viola. 中提琴。
To install modules for the system perl, you can install the packages from the Ubuntu repositories. 要为系统perl安装模块,可以从Ubuntu存储库安装软件包。 While these may be out of date, library dependencies are resolved aoutomatically.
虽然这些可能已过时,但库依赖关系是经常解决的。 In this case, a
在这种情况下,一个
$ sudo apt-get install libdbd-sybase-perl
should do the trick. 应该做的伎俩。
我相信你必须创建include
子目录,否则第二个ln
将失败:
mkdir /tmp/freetds/include
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.