ssk
ssk

Reputation: 9265

Selectively include headers in Qt using preprocessors

I am trying to include windows specific headers on a cross-platform project in the following way.

#ifdef Q_OS_WIN
#include "qt_windows.h"
#include "Shellapi.h"
#endif

For some reasons, the files are not included properly.

Note: I am using mingw-gcc compiler.

Upvotes: 1

Views: 1544

Answers (1)

Anthony
Anthony

Reputation: 8788

I don't think that is defined. It should be Q_OS_WIN32 or Q_WS_WIN. See Qt Global.

#include <QtGlobal>

#ifdef Q_OS_WIN32
#include "qt_windows.h"
#include "Shellapi.h"
#endif

Upvotes: 3

Related Questions