使用 Ubuntu,如何从 CPAN 安装 DBD::Sybase? [英] Using Ubuntu, how do I install DBD::Sybase from CPAN?

查看:35
本文介绍了使用 Ubuntu,如何从 CPAN 安装 DBD::Sybase?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试构建 DBD::Sybase 以连接到 MSSQL 时,我都会收到一个错误,

Whenever I try to build DBD::Sybase to connect to MSSQL I get an error,

$ 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

我在其他 Debian 系统上也遇到过这个错误.

I've also gotten this error on other Debian systems.

推荐答案

有两种方法可以做到这一点,

There are two ways to do that,

  • (a) 使用发行版提供的 freetds
  • 或者,(b) 在上游安装 vanilla freetds 并针对它进行构建.

第二个选项 (b) 总是可能的,但是你的系统可能有两个不同版本的 freetds.

The second option (b) is always possible, but then your system may have two different versions of 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.

在内部 DBD::Sybase 期望有一个目录和一个 $libdir(带有 liblib64 的子目录).DBD::Sybase 需要正确构建的目录由 Debian 软件包 freetds-dev 提供;Debian 软件包安装到 /usr/include ,它没有 liblib64 子目录.您可以通过欺骗 make 并重新创建该结构来解决此问题,首先确保您已安装 freetds-dev

Internally DBD::Sybase expects there to be a directory, and a $libdir (a subdirectory with lib or lib64). The directories DBD::Sybase requires to build properly are not provided by the Debian package freetds-dev; the Debian package installs to /usr/include which doesn't have a lib or a lib64 subdirectory. You can get around this by fooling make and recreating that structure, first make sure you have freetds-dev installed,

sudo apt-get install freetds-dev

然后链接它以创建一个伪包.在我的 64 位机器上,它看起来像这样.

Then link it to create a pseudo-package. On my 64 bit machine, it looks something like this.

mkdir /tmp/freetds
ln -s /usr/lib/x86_64-linux-gnu/ /tmp/freetds/lib64
ln -s /usr/include /tmp/freetds/include/freetds

现在,它应该可以工作了,您可以针对系统库构建 DBD::Sybase.

Now, it should work and you can build DBD::Sybase against system libraries.

sudo SYBASE=/tmp/freetds cpanp install DBD::Sybase

中提琴.

这篇关于使用 Ubuntu,如何从 CPAN 安装 DBD::Sybase?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆