ubuntu 安装PCRE时出错

l7mqbcuq  于 2023-03-22  发布在  其他
关注(0)|答案(8)|浏览(426)

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

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

h43kikqp

h43kikqp1#

你需要安装一个C编译器,你很可能需要g
使用apt-get,运行'apt-get install g++'或'apt-get install build-essential',因为build-essential包含g++。

x7rlezfr

x7rlezfr2#

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

./configure --disable-cpp

禁用C++选项。

ohfgkhjo

ohfgkhjo3#

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

mm5n2pyu4#

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

  1. apt-get安装构建-必要
  2. apt-get install libtool
    1.安装libpcre 3-dev
  3. apt-get install libpcre3
bq3bfh9z

bq3bfh9z5#

当我运行configure时,我得到:
libpcre正在检查windows.h... no configure:错误:无效的C编译器或C编译器标志
修复是安装g++如Fredrik提到.在CentOS:yum install gcc-c++

cyvaqqii

cyvaqqii6#

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

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

cnwbcb6i7#

我找到了原因的答案,但没有治愈的方法;(我知道这是一个老问题,但我想我会贡献无论如何)。
我发现我的系统上已经安装了pcre,但是显然 *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

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

vq8itlhq

vq8itlhq8#

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

相关问题