I need to find an available (installed on the system) version of GCC (Major and minor) inside the execution of program c (at runtime). The point is to programmatically extract the version of available gcc (just as if I were in the shell and typed gcc -version, but in a c-program).
__GNUC__ and __GNUC_MINOR__ are only useful at compile time, and I found the gnu_get_libc_version() function from gnu/libc_version.h , but it only returns me the libc version, and I need the GCC version. If there is something like this for GCC, it would be great ...
I would really like to avoid invoking the shell command for this.
source share