Linux 无包装';libxml-2.0';建立

Linux 无包装';libxml-2.0';建立,linux,macos,unix,libxml2,vsdoc,Linux,Macos,Unix,Libxml2,Vsdoc,我正在尝试将libvisio从添加到mac os x中 我已经添加了下面列出的所有依赖性: boost gperf icu librevenge libxml2 perl doxygen 添加依赖项后,我尝试运行以下命令 $ ./autogen.sh ''# only needed for building from git'' $ ./configure $ make $ make install 但是我在第二个命令$。/configure 得到贝娄错误 configure: error:

我正在尝试将libvisio从添加到mac os x中

我已经添加了下面列出的所有依赖性:

boost
gperf
icu
librevenge
libxml2
perl
doxygen
添加依赖项后,我尝试运行以下命令

$ ./autogen.sh ''# only needed for building from git''
$ ./configure
$ make
$ make install
但是我在第二个命令
$。/configure

得到贝娄错误

configure: error: Package requirements (
    libxml-2.0
) were not met:

No package 'libxml-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBXML_CFLAGS
and LIBXML_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
我曾尝试使用
$brew install libxml
安装libxml2,但其上显示
警告:libxml2-2.9.3已安装

我正在使用OS X 10.11.4

有人能帮我吗。谢谢


找不到程序包“libxml-2.0”

表示通常在libxml2开发文件中找不到“/usr/lib/pkgconfig/libxml-2.0.pc”。比如“libxml2-devel”


因此,您已经在brew中安装了libxml2。正如brew在安装libxml2时告诉您的:

margold@home-macbook ~ $ brew install libxml2
(...)
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/libxml2/lib
    CPPFLAGS: -I/usr/local/opt/libxml2/include
(...)
这意味着brew没有将libxml2符号链接到/usr/local/lib和/usr/local/include,并且可能也没有链接那里的pkg配置文件,这就是为什么libvisio找不到它的原因

因此,在运行
/configure
时,必须指定libxml2的位置,就像brew和libvisio告诉您的那样:

./configure LIBXML_CFLAGS=-I/usr/local/opt/libxml2/include LIBXML_LIBS=-L/usr/local/opt/libxml2/lib
(系统上的路径可能会有所不同,请务必检查!)

解决此问题的其他方法:

  • 直接使用brew安装libvisio
  • 将libxml的
    inlcude/
    lib/
    pkg config
    文件符号链接到
    /usr/local/
    您自己

由于我没有brew,这也应该可以工作:

yum install libxml2-devel

对于Ubuntu,以下内容帮助了我:

apt get install libxml2 dev
我在Ubuntu 16.04上从源代码构建PHP7.4时遇到了这个问题,我用与上面建议的OSX相同的方法修复了这个问题,并为libxml2 dev安装了dev包

sudo apt-get install libxml2-dev
./configure LIBXML_CFLAGS=-I/usr/include LIBXML_LIBS=-L/usr/lib/x86_64-linux-gnu/ ....
阿尔卑斯山

apk add libxml2-dev

是的,我认为它正在/usr/lib/pkgconfig/direcotry中寻找libxml-2.0.pc,但它不在那里。我注意到libxml-2.0.pc存在于其他目录中,即/usr/local/ceral/libxml2/2.9.3/lib/pkgconfig和/usr/local/Library/ENV/pkgconfig/。那么如何在/usr/lib/pkgconfig/中添加libxml-2.0.pc呢。我对此一无所知,如果我要求这么愚蠢的事情,我很抱歉。libxml-2.0.pc:建议您提供一份副本或指向/usr/lib/pkgconfig/i已安装libxml2的链接。。。但不是libxml2-devel。谢谢这对我不管用。您如何知道名称
LIBXML\u CFLAGS
LIBXML\u LIBS
?我直接从问题中粘贴的
/configure
错误消息中获取它们。首先,你应该仔细查看你收到的错误信息,看看它是否能给你任何线索。您可能还需要安装
libxml2-devel
,如下所示。粘贴的消息来自Brew。据我所知,它没有提到“LIBXML_CFLAGS”和“LIBXML_LIBS”的名称。它只提到了它们的值应该是什么,这就是为什么我很好奇你怎么知道它们应该被称为“LIBXML_CFLAGS”和“LIBXML_LIBS”。对于LIBXML++2.6,sudo apt get install LIBXML++2.6-devthanks,这可以通过安装
apt get install pkg config
而不是设置每个库的路径来解决。谢谢,实际上,我的问题是PKG_CONFIG_路径设置不正确。我已经安装了pkg config,但路径指向正确的位置(AWS实例)