Supported Operating Systems and Definitions in Qt

Posted on Posted in Qt Tutorials, Tutorials

Following is a list of Operating Systems and their codes (as Qt calls them) which can be used in #ifdef and #ifndef compiler directives. Note that it is taken from qsystemdetection.h and you should always refer to it for the most updated values:

The operating system, must be one of: (Q_OS_x)

DARWIN – Any Darwin system (OS X, iOS, watchOS, tvOS)
OSX – OS X
IOS – iOS
WATCHOS – watchOS
TVOS – tvOS
MSDOS – MS-DOS and Windows
OS2 – OS/2
OS2EMX – XFree86 on OS/2 (not PM)
WIN32 – Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008)
WINCE – WinCE (Windows CE 5.0)
WINRT – WinRT (Windows 8 Runtime)
CYGWIN – Cygwin
SOLARIS – Sun Solaris
HPUX – HP-UX
ULTRIX – DEC Ultrix
LINUX – Linux [has variants]
FREEBSD – FreeBSD [has variants]
NETBSD – NetBSD
OPENBSD – OpenBSD
BSDI – BSD/OS
IRIX – SGI Irix
OSF – HP Tru64 UNIX
SCO – SCO OpenServer 5
UNIXWARE – UnixWare 7, Open UNIX 8
AIX – AIX
HURD – GNU Hurd
DGUX – DG/UX
RELIANT – Reliant UNIX
DYNIX – DYNIX/ptx
QNX – QNX [has variants]
QNX6 – QNX RTP 6.1
LYNX – LynxOS
BSD4 – Any BSD 4.4 system
UNIX – Any UNIX BSD/SYSV system
ANDROID – Android platform
HAIKU – Haiku

The following operating systems have variants:
LINUX – both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android
– only Q_OS_LINUX is defined if building for other Linux systems
FREEBSD – Q_OS_FREEBSD is defined only when building for FreeBSD with a BSD userland
– Q_OS_FREEBSD_KERNEL is always defined on FreeBSD, even if the userland is from GNU

Leave a Reply

Your email address will not be published. Required fields are marked *