2016-05-19 56 views
1

我試圖從https://wiki.documentfoundation.org/DLP/Libraries/libvisio無包「中的libxml-2.0」發現

在我的Mac OS X中添加libvisio我添加了所有扶養描述波紋管有幾種:

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的,但是它說​​。

我正在使用OS X 10.11.4

有人可以幫我解決這個問題。由於

回答

2

因此,您已經安裝了libxml2並使用brew。由於BREW告訴你,當它安裝的libxml2:

[email protected] ~ $ 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 /本地/包括,且可能不鏈接pkg配置文件中有作爲那麼,這就是爲什麼libvisio無法找到它。

所以,你必須在運行./configure指定的libxml2的位置,就像啤酒,libvisio告訴你:

./configure LIBXML_CFLAGS=-I/usr/local/opt/libxml2/include LIBXML_LIBS=-L/usr/local/opt/libxml2/lib 

(!您的系統可能會有所不同,所以做檢查的路徑上)

其他方式來解決這個問題:

  • 安裝libvisio與釀造直接
  • 的libxml的inlcude/lib/pkg-config文件符號鏈接到/usr/local/自己
+0

這對我不起作用。你怎麼知道名字'LIBXML_CFLAGS'和'LIBXML_LIBS'? –

+0

我直接從粘貼在問題中的'./configure'錯誤消息中取出它們。你應該首先仔細看看你得到的錯誤信息,看看它是否給你提供任何線索。您可能還需要安裝'libxml2-devel',正如以下答案所述。 – margold

+0

粘貼的消息來自Brew。就我所見,它沒有提及名稱「LIBXML_CFLAGS」和「LIBXML_LIBS」。它只提到他們的價值應該是什麼,這就是爲什麼我很好奇你怎麼知道他們應該被稱爲「LIBXML_CFLAGS」和「LIBXML_LIBS」。 –

0

無包 '中的libxml-2.0' 發現

意味着沒有 「/ usr/lib中/ pkgconfig/的libxml-2.0.pc」,通常在libxml2的發展文件中找到。像「libxml2-devel」?


+0

是的,我認爲這是尋找libxml- 2.0.pc在/ usr/lib/pkgconfig/direcotry中,但它不在那裏。我注意到libxml-2.0.pc存在於其他目錄中,即/usr/local/Cellar/libxml2/2.9.3/lib/pkgconfig和/ usr/local/Library/ENV/pkgconfig /。那麼我如何在/ usr/lib/pkgconfig /中添加libxml-2.0.pc。如果我要求這樣愚蠢的事情,我很抱歉,我很抱歉。 – Rohan

+0

libxml-2.0.pc:建議副本或鏈接到/ usr/lib/pkgconfig/ –

3

這也應該工作,我沒有BREW:

yum install libxml2-devel 
+0

我安裝了libxml2 ...但不是libxml2-devel。謝謝! – AceFunk