简体   繁体   English

在 Solaris 11 上通过 CPAN 提示安装 DBI Perl 模块时出现问题

[英]Issue while installing DBI Perl module via CPAN prompt on Solaris 11

I am getting error " sh: cc: not found " when I try to install DBI module from CPAN prompt.当我尝试从 CPAN 提示符安装DBI模块时出现错误“ sh: cc: not found ”。 Is there any way to resolve this?有什么办法可以解决这个问题吗? I have already installed gcc compiler from gnu site.我已经从 gnu 站点安装了gcc编译器。

        $ which gcc
        /bin/gcc
        $

and environment variable is already set like this cc=gcc并且环境变量已经像这样设置cc=gcc

But, still I got this error:但是,我仍然收到此错误:

cc -c    -I/usr/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO3    -DVERSION=\"1.643\"  -DXS_VERSION=\"1.643\" -KPIC "-I/usr/perl5/5.12/lib/sun4-solaris-64int/CORE"  -DDBI_NO_THREADS Perl.c
sh: cc: not found
*** Error code 127
make: Fatal error: Command failed for target `Perl.o'
Current working directory /root/.cpan/build/DBI-1.643-2
  TIMB/DBI-1.643.tar.gz
  /usr/bin/make -- NOT OK
Failed during this command:
 TIMB/DBI-1.643.tar.gz                        : make NO

In order to avoid any binary incompatibilities, Perl expects all C code to be compiled with the same compiler as was used to build Perl itself.为了避免任何二进制不兼容,Perl 期望所有 C 代码使用与用于构建 Perl 本身的相同编译器编译。 It looks like you're using the standard Solaris installation of Perl. That will have been built with the Solaris C compiler, not with gcc (you can check by running perl -V:cc ).看起来您正在使用 Perl 的标准 Solaris 安装。它将使用 Solaris C 编译器构建,而不是使用gcc (您可以通过运行perl -V:cc进行检查)。

So you're going to need the Solaris C compiler installed in order to install any CPAN modules that require C code to be compiled.因此,您将需要安装 Solaris C 编译器,以便安装任何需要编译 C 代码的 CPAN 模块。

It's been years (decades probably) since I used Solaris.自从我使用 Solaris 以来已经有好几年(可能几十年了)。 Is there no standardised package repository that you can use to install extra packages - something like RedHat's rpm ?是否没有可用于安装额外软件包的标准化 package 存储库 - 类似于 RedHat 的rpm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM