I tried this logic (../Helpers/nestleanconstants.h):

#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #define NESTLEAN_MOBILE 1 #else #define NESTLEAN_DESKTOP 1 #endif

And header of class:

#ifndef NESTLEANREQUESTMANAGER_H #define NESTLEANREQUESTMANAGER_H #include <QtCore> #include <QtNetwork> #include "../Helpers/nestleanconstants.h" //Others headers #if defined(NESTLEAN_DESKTOP) #include "WebSocket/nestleanwebsocketmanager.h" #endif class NestleanRequestManager : public QObject { Q_OBJECT Q_CLASSINFO("version", "1.1") Q_PROPERTY(NestleanApplicationRequestsManager* appManager READ getAppManager) //other properties #if defined(NESTLEAN_DESKTOP) Q_PROPERTY(NestleanWebSocketManager* webSocketManager READ getWebSocketManager) #endif private: //some code #if defined(NESTLEAN_DESKTOP) NestleanWebSocketManager* m_webSocketManager; #endif public: //some code #if defined(NESTLEAN_DESKTOP) inline NestleanWebSocketManager* getWebSocketManager() { return m_webSocketManager; } #endif signals: public slots: }; #endif // NESTLEANREQUESTMANAGER_H

Errors the same. I can't understand why it happens.