我已经在我的 Ubuntu 20.04 终端(在 WSL 下)安装了 libxml2-dev,因为它是pgModeler的要求。我用过sudo apt-get install libxml2-dev,看起来安装没问题。pgModeler 指令包括“检查库是否已正确安装”,请运行以下命令:pkg-config libxml\xc2\xad2.0 --cflags --libs\n对我来说,这给出了:
\n\nRun Code Online (Sandbox Code Playgroud)\nPackage libxml2.0 was not found in the pkg-config search path. \nPerhaps you should add the directory containing \'libxml2.0.pc\'\nto the PKG_CONFIG_PATH environment variable \nNo package \'libxml2.0\' found\n
一些问题的答案建议将路径添加到 PKG_CONFIG_PATH。为了确定要检查的路径,我安装了locate( sudo apt install mlocate)并使用locate libxml | grep \'\\.pc\',我发现这个文件存在:
\n\n/usr/lib/x86_64-linux-gnu/pkgconfig/libxml-2.0.pc
\n
然后运行pkg-config --variable pc_path pkg-config给出(我的突出显示):
\n\n/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig: /usr/lib/x86_64-linux-gnu/pkgconfig :/usr/lib /pkgconfig:/usr/share/pkgconfig
\n
这向我表明它/usr/lib/x86_64-linux-gnu/pkgconfig已经在 的默认路径中pkg-config。
那么,为什么我会收到“找不到包 \'libxml2.0\'”,我该如何解决这个问题?
\n您必须忽略 pgModeler文档中的建议。
pkg-config 的 libxml2 配置文件的正确名称是libxml-2.0.pc,您已经从libxml2-devpackage 中安装了它。
简单地继续编译:
sudo apt-get install git build-essential libxml2-dev qt5-default libpqxx-dev libpq-dev libqt5svg5-dev qttools5-dev
cd ~/Downloads
git clone https://github.com/pgmodeler/pgmodeler.git -b master
cd pgmodeler
git clone https://github.com/pgmodeler/plugins -b master
qmake PREFIX+=/usr/local -r pgmodeler.pro
make -j$(nproc)
sudo make install
Run Code Online (Sandbox Code Playgroud)
另外你应该知道 pgModeler 0.9.2 打包在 Ubuntu 20.04 LTS 中,网址为https://packages.ubuntu.com/focal/pgmodeler,因此安装起来非常简单
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install pgmodeler
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7300 次 |
| 最近记录: |