安装PCRE时出错

时间:2011-10-23 13:36:49

标签: linux gcc ubuntu pcre libtool

我正在尝试在我的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

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

7 个答案:

答案 0 :(得分:19)

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

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

答案 1 :(得分:15)

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

./configure --disable-cpp 

禁用C ++选项。

答案 2 :(得分:7)

为什么不使用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

答案 3 :(得分:6)

我遇到了同样的问题,解决方法是在其他答案安装PCRE的开发文件时做一切建议:

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

答案 4 :(得分:1)

当我运行configure时,我得到:

libpcre检查windows.h ...没有配置:错误:无效的C ++编译器或C ++编译器标志

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

答案 5 :(得分:0)

我找到了答案,但不是治愈方法; (我知道这是一个古老的问题,但我认为无论如何我都会做出贡献。)

我发现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

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

答案 6 :(得分:0)

要安装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