0

I'm trying to put together a project using the Qt framework, and recently have been trying to integrate JACK audio. However, when adding

#include <jack/control.h>

along with any of the QtCore files (it does it for both QCoreApplication and QObject), the compiler gives me an error that stops any further progress... This error comes from one of the QtCore files that usually should compile without issue.

/home/user/Qt5.13.1/5.13.1/gcc_64/include/QtCore/qobjectdefs.h:97: error: expected ',' or '...' before 'public'

# define Q_SIGNALS public QT_ANNOTATE_ACCESS_SPECIFIER(qt_signal)
                    ^~~~~~

This seems to only happen when jack/control.h is included. I also noticed in the file itself that signals is used as a (seemingly irrelevant?) argument keyword. I tried changing the keyword without success.

Reversing the order of the #include's just makes anything jack-dependent not work. Which also seems weird to me...

Any suggestions on how to move forward with this type of issue?

Maxime Franchot
  • 1,015
  • 1
  • 10
  • 24
  • 1
    Try `CONFIG += no_keywords` (if using QMake) or define the corresponding defines manually, see also https://stackoverflow.com/questions/22188432/qt-macro-keywords-cause-name-collisions – Frank Osterfeld Jan 15 '20 at 07:22
  • The `no_keywords` setting can't work if I am using signals and slots, but using `#undef signals` before the `#include ` did work just fine. Thank you! – Maxime Franchot Jan 16 '20 at 02:58
  • extern "C" { #include } ??? – Deep Jan 21 '20 at 08:24
  • @Deep thanks, will try it when I get the chance. The code finally ended up not working (despite keywords changed or `#undef`), the compiler rejects any use of the included class. I'm not familiar with `extern` so I can't predict how it'll act, I'll post the result tomorrow – Maxime Franchot Jan 21 '20 at 12:38
  • @Deep doesn't work. – Maxime Franchot Jan 22 '20 at 08:13
  • doesn't work - same errors or other? – Deep Jan 22 '20 at 14:04
  • @Deep Same error. For some reason, the `#include ` works and its members are usable, while `#include ` seems to have members declared (they are recognized) but the definitions do not get through - errors come up when compiling saying the members are not defined. – Maxime Franchot Jan 24 '20 at 05:10

0 Answers0