by JCWasmx86 · 3y ago · 0 comments
Add `--libs` to link against it, too: -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -lglib-2.0
With meson that is basically `dependency('glib-2.0')` that you add to your executable/library.
> you expect your users to install your app dependencies for you, and you have to figure out the path of your own dependencies.
If you use a good buildsystem, it will find those dependencies automagically or you can e.g. use wrap dependencies: https://mesonbuild.com/Wrap-dependency-system-manual.html Those do automatically download the dependencies and compile them for you
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!