3 ms·
> You can use pkg-config for that. E.g. if you want to compile with glib-2.0, you can run `pkg-config --cflags glib-2.0 That works sometimes, but is there a ge
by johndough 4y ago
> You can use pkg-config for that. E.g. if you want to compile with glib-2.0, you can run `pkg-config --cflags glib-2.0
That works sometimes, but is there a general way to find out what to pass to pkg-config besides consulting StackOverflow (or now perhaps ChatGPT)? For example, my recent history looked something like:
sudo apt install libopencv-dev
pkg-config --libs opencv # did not work
pkg-config --libs OpenCV # did not work
pkg-config --libs opencv-core # did not work
pkg-config --libs opencv45 # did not work
pkg-config --libs OpenCV45 # did not work
pkg-config --libs opencv4.5 # did not work
pkg-config --libs OpenCV4.5 # did not work
pkg-config --libs opencv-4.5 # did not work
pkg-config --libs OpenCV-4.5 # did not work
pkg-config --libs opencv-4 # did not work
pkg-config --libs OpenCV-4 # did not work
pkg-config --libs opencv4 # success!
- MawKKe 4y agopkg-config --list-all | grep keyword
- lost_tourist 4y agogrep -i :) since case sensitivity matters
- kps 4y agoThe Unix answer was to read the man page. The Debian answer (since I see `apt`) is `dpkg-query -L libopencv-dev | grep /pkgconfig/`
- JCWasmx86 4y agoAt least for me, pkg-config has auto completion (Fedora), so typing e.g. `pkg-config open<TAB>` would give probably give me some results. But I agree that's one weakness of pkg-config, that you have to guess the name a bit