PDA

View Full Version : How to check if g++ exist in system.



sawerset
1st December 2008, 09:51
How with QT can be checked that g++ exest in system.

jacek
1st December 2008, 09:57
The easiest way is to run it (for example with --version parameter). But you can't do more than that in an system-independent manner. On Linux you could check what package package manager is installed and query it, but if g++ was installed from sources it can be anywhere.

wysota
1st December 2008, 09:58
You can call system("which g++") or getenv("PATH"), split it with colons and check whether a g++ file exists in any of the path components. I think you could also call QProcess with "g++ -v" and see what result you get.