I would like to make a system call to a Linux program from my C++ code, but I would like to check whether the program is installed on the user's machine first.
In Ubuntu, I can determine whether a package associated with that program was installed using a system call like dpkg -s gifsicle and parse its output. gifsicle here is the program name.
However, it's possible that the program (e.g. gifsicle) was compiled from source and thus does not appear in the Ubuntu package repository.
What's a good programmatic way of determining whether a program (e.g. gifsicle) is available on the system executing the C++ code?