Qt macro keywords cause name conflicts

I am creating an NCurses interface for my Qt project. I want to use the CDK, but I think that the signalselements of this structure comes across the signalsQt keyword .

/usr/include/linux/cdk.h:411: error: expected unqualified-id before 'protected'

How do I get the CDK to work with Qt?

+5
source share
1 answer

You can define the macro QT_NO_KEYWORDS, which disables the macros "signals" and "slots".

If you are using QMake:

 CONFIG += no_keywords

( Qt documentation here )

If you use a different build system, do whatever it takes to pass it to the -DQT_NO_KEYWORDScompiler.

QT_NO_KEYWORDS signals Q_SIGNALS slots Q_SLOTS Qt-.

Qt, . , " ", "" cdk.h:

#undef signals
#include <cdk.h>

no_keywords, , .

+9

Source: https://habr.com/ru/post/1530165/


All Articles