【问题标题】:Error installing PCRE安装 PCRE 时出错
【发布时间】:2011-12-13 13:34:37
【问题描述】:

我正在尝试在我的 Ubuntu 11.10 服务器上安装 PCRE。当我运行“make”命令时,我得到一个很长的输出,总是以这个错误结束:

libtool: link: ( cd ".libs" && rm -f "libpcreposix.la" && ln -s "../libpcreposix.la" "libpcreposix.la" ) source='pcrecpp.cc' object='pcrecpp.lo' libtool=yes \
        DEPDIR=.deps depmode=none /bin/bash ./depcomp \
        /bin/bash ./libtool --tag=CXX   --mode=compile  -DHAVE_CONFIG_H -I.      -c -o pcrecpp.lo pcrecpp.cc libtool: compile: unrecognized option `-DHAVE_CONFIG_H' libtool: compile: Try `libtool
--help' for more information. make[1]: *** [pcrecpp.lo] Error 1 make[1]: Leaving directory `/home/root/src/pcre/pcre-8.12' make:
*** [all] Error 2

我确实运行了“配置”。有什么想法吗?

【问题讨论】:

  • 哪个pcre? (压缩包名称)

标签: linux gcc ubuntu pcre libtool


【解决方案1】:

您需要安装 C++ 编译器,您很可能需要 g++。

使用 apt-get,运行“apt-get install g++”或“apt-get install build-essential”,因为 build-essential 包含 g++。

【讨论】:

  • 确实,${CXX} 似乎已经扩展为这里的空字符串。可以说,pcre 的配置应该已经抓住了这一点 - 或者不尝试构建 pcrecpp。
  • 这样做并不适合我。这是同样的错误。我需要指定一些configure 选项吗?
  • minitech:你能看到 $CXX 扩展成什么吗? 'g++ --version' 给出什么输出?
  • @minitech 我不知道你是否这样做了,但我收到了同样的错误,即使在安装了 build-essential 之后也是如此。我所做的是删除 pcre-8.31 目录。再次解压,执行 ./configure 然后 make 工作!
  • 我在安装过程中遇到了这个错误:bugzilla.redhat.com/show_bug.cgi?id=494006。运行 yum clean metadata 解决了错误,我能够安装 gcc-c++。
【解决方案2】:

为什么不用apt-cache search pcre | grep pcre找到PCRE,然后用apt-get install安装PCRE呢?我认为 PCRE 已经包含在存储库中。

这是在我的电脑(Ubuntu 10.04)上执行上述命令的结果:

$ apt-cache search pcre | grep pcre
libpcre3-dbg - Perl 5 Compatible Regular Expression Library - debug symbols
libpcre3-dev - Perl 5 Compatible Regular Expression Library - development files
libpcrecpp0 - Perl 5 Compatible Regular Expression Library - C++ runtime files
libpcre3 - Perl 5 Compatible Regular Expression Library - runtime files
cl-ppcre - Portable Regular Express Library for Common Lisp
gambas2-gb-pcre - The Gambas regexp component
haskell-pcre-light-doc - library documentation for pcre-light
libghc6-pcre-light-dev - Haskell library for Perl 5-compatible regular expressions
libghc6-pcre-light-prof - pcre-light library with profiling enabled
liblua5.1-rex-pcre-dev - PCRE development files for the Lua language version 5.1
liblua5.1-rex-pcre0 - Perl regular expressions library for the Lua language version 5.1
libpcre++-dev - C++ wrapper class for pcre (development)
libpcre++0 - C++ wrapper class for pcre (runtime)
libpcre-ocaml - OCaml bindings for PCRE (runtime)
libpcre-ocaml-dev - OCaml bindings for PCRE (Perl Compatible Regular Expression)
pcregrep - grep utility that uses perl 5 compatible regexes.
pike7.6-pcre - PCRE module for Pike
sqlite3-pcre - Perl-compatible regular expression support for SQLite
postfix-pcre - PCRE map support for Postfix

【讨论】:

  • 人们正在尝试安装版本 8。TheBuggenie 使用 pcre 版本 8,天知道他们为什么会使用一些无法启动他们的产品的东西。安装 buggenie 很痛苦。
【解决方案3】:

我找到了原因的答案,但不是治愈方法; (我知道这是一个老问题,但我想我还是会做出贡献)。

我发现我的系统上已经安装了 pcre,但显然 libtool 没有。当我试图 sudo apt-get install libtool 我得到了

Package libtool is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

不知道为什么会发生这种情况,但正在努力找出答案!希望这能回答您的问题。

【讨论】:

【解决方案4】:

我遇到了同样的问题,解决方案是执行其他答案中建议的所有操作安装 PCRE 的开发文件:

  1. apt-get install build-essential
  2. apt-get install libtool
  3. apt-get install libpcre3-dev
  4. apt-get 安装 libpcre3

【讨论】:

    【解决方案5】:

    PCRE 尝试在没有 c++ 编译器的情况下构建 c++ 输出。试试

    ./configure --disable-cpp 
    

    禁用 C++ 选项。

    【讨论】:

    • 如果使用 --without-pgsql 禁用 cpp,会有什么后果??
    【解决方案6】:

    要安装pcre 包,你需要运行2个命令:

    1. apt-get install libpcre3 libpcre3-dev
    2. apt-get install build-essential libpcre3-dev libxslt1-dev libgd2-xpm-dev libgeoip-dev libssl-dev

    【讨论】:

    • 您好!非常简短的答案通常在这里很少被接受。如果你可以让你的答案更长,你就会开始获得支持。
    【解决方案7】:

    当我运行配置时,我得到:

    libpcre 检查 windows.h... no configure: error: Invalid C++ compiler or C++ compiler flags

    修复是按照 Fredrik 提到的那样安装 g++。在 CentOS 上:yum install gcc-c++

    【讨论】:

      猜你喜欢
      • 2012-09-21
      • 1970-01-01
      • 2011-05-14
      • 1970-01-01
      • 1970-01-01
      • 2020-09-12
      • 2013-10-05
      • 2013-08-15
      • 2013-11-13
      相关资源
      最近更新 更多