I've installed libxml2-dev in my Ubuntu 20.04 terminal (under WSL), as it's a requirement for pgModeler. I used sudo apt-get install libxml2-dev
and it seemed to install ok. The pgModeler instruction includes "To check if the library is correctly installed" run this command: pkg-config libxml2.0 --cflags --libs
For me, this gives:
Package libxml2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing 'libxml2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml2.0' found
Answers to some questions suggest adding the path to PKG_CONFIG_PATH. To determine what path to check, I installed locate (sudo apt install mlocate
) and using locate libxml | grep '\.pc'
, I found that this file exists:
/usr/lib/x86_64-linux-gnu/pkgconfig/libxml-2.0.pc
Then running pkg-config --variable pc_path pkg-config
gives (my highlighting):
/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
which indicates to me that /usr/lib/x86_64-linux-gnu/pkgconfig
is already in the default path for pkg-config
.
So, why would I get "No package 'libxml2.0' found", and how might I fix this?