2

I'm using Qt to write a desktop application that includes an external library. The problem is that I get an error when including the external library:

.../sc_containers.h:667: error: expected unqualified-id before ';' token
   sc_array_t         *slots;
                            ^

I successfully included the same library in a non-qt project before, so I assume that this error is related to the fact that Qt uses slots as a special keyword (see here in the Qt documentation).

Is there a way that I can use that external library in my program? Since this is not my own library, changing the variable name to something else isn't really an option.

Thanks in advance!

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
Felix
  • 6,131
  • 4
  • 24
  • 44

1 Answers1

10

Adding QT_NO_KEYWORDS (-DQT_NO_KEYWORDS) definition to your build will prevent Qt from defining foreach, signals, slots which may collide with other frameworks.

Related answer:

Related doc:

Community
  • 1
  • 1
alediaferia
  • 2,537
  • 19
  • 22