找不到包"libxml-2.0"

Roh*_*han 8 unix linux macos libxml2 vsdoc

我试图在我的mac os x中添加libvisio来自https://wiki.documentfoundation.org/DLP/Libraries/libvisio

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

boost
gperf
icu
librevenge
libxml2
perl
doxygen
Run Code Online (Sandbox Code Playgroud)

添加依赖项后,我试图运行波纹管命令.

$ ./autogen.sh ''# only needed for building from git''
$ ./configure
$ make
$ make install
Run Code Online (Sandbox Code Playgroud)

但我有第二个命令的问题 $ ./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.
Run Code Online (Sandbox Code Playgroud)

我试图安装libxml2,$ brew install libxml但它说Warning: libxml2-2.9.3 already installed.

我使用的是OS X 10.11.4

有人可以帮助我.谢谢

yas*_*ini 11

对于高山

apk add libxml2-dev
Run Code Online (Sandbox Code Playgroud)


小智 9

这应该也可以,因为我没有酿造:

yum install libxml2-devel
Run Code Online (Sandbox Code Playgroud)


mar*_*old 7

因此,您已经使用 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
(...)
Run Code Online (Sandbox Code Playgroud)

这意味着 brew 没有将 libxml2 符号链接到 /usr/local/lib 和 /usr/local/include,并且可能也没有将 pkg-config 文件链接到那里,这就是 libvisio 找不到它的原因。

所以你必须在运行时指定 libxml2 的位置./configure,就像 brew 和 libvisio 告诉你的那样:

./configure LIBXML_CFLAGS=-I/usr/local/opt/libxml2/include LIBXML_LIBS=-L/usr/local/opt/libxml2/lib
Run Code Online (Sandbox Code Playgroud)

(您系统上的路径可能会有所不同,因此请务必检查!)

解决此问题的其他方法:

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


Xol*_*ani 6

对于Ubuntu,以下帮助了我

apt-get安装libxml2-dev


The*_*ane 5

我在 Ubuntu 16.04 上从源代码构建 PHP 7.4 时遇到了这个问题,我通过使用上面建议的 OSX 相同的方式 + 安装 libxml2-dev 的开发包来修复该问题

sudo apt-get install libxml2-dev
./configure LIBXML_CFLAGS=-I/usr/include LIBXML_LIBS=-L/usr/lib/x86_64-linux-gnu/ ....
Run Code Online (Sandbox Code Playgroud)

  • 谢谢,这可以通过安装`apt-get install pkg-config`来解决,而不是设置每个库的路径。 (2认同)