#include#include int main() { QFileInfo fileInfo("/usr/local/bin/java"); qDebug() << fileInfo.canonicalFilePath(); return 0; }
#includeThis code creates a QFileInfo object for Notepad.exe on a Windows system. It then calls the canonicalFilePath() method to get the absolute path of the executable with all symbolic links resolved. The output of this program might be "C:\Windows\system32\notepad.exe" if the symbolic links were resolved correctly. The QFileInfo class is part of the QtCore package/library in the Qt framework.#include int main() { QFileInfo fileInfo("C:/Documents/../../Windows/system32/notepad.exe"); qDebug() << fileInfo.canonicalFilePath(); return 0; }