How can i get data regardless of OS? I'm using Qt Creator and C++
MEMORYSTATUSEX status;
status.dwLength = sizeof(status);
GlobalMemoryStatusEx(&status);
unsigned long long installedRAM = status.ullTotalPhys;
ui->label_21->setText(QString("Installed memory: %1 GB").arg(installedRAM / 1024.0 / 1024.0 / 1024.0, 0, 'f', 1));
So, I have this code, but as I know, it only works on Windows.