Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. expected unqualified-id before ';' token
QtWS25 Last Chance

expected unqualified-id before ';' token

Scheduled Pinned Locked Moved Solved 3rd Party Software
slotskeywor3rd party
6 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sorut
    wrote on 22 Feb 2022, 14:14 last edited by Sorut
    #1

    Hi everybody,

    one task in my current project is to use a special network library. When the basic header for this library is included, the mentioned error appears. The error points to the following variable declaration in the header file:

    char *slots;

    Normally It would be possible to use the no_keywords config. But in this case it is not possible. The project is an add-on for a certain software, which uses Qt with the keywords enabled. Setting the no_keywords config breaks compiling.

    Is there any way, to tell Qt/moc/whatever to ignore the slots variable in the third party library?

    Help is very much appreciated
    Sorut

    J 1 Reply Last reply 22 Feb 2022, 14:25
    0
    • S Sorut
      22 Feb 2022, 14:14

      Hi everybody,

      one task in my current project is to use a special network library. When the basic header for this library is included, the mentioned error appears. The error points to the following variable declaration in the header file:

      char *slots;

      Normally It would be possible to use the no_keywords config. But in this case it is not possible. The project is an add-on for a certain software, which uses Qt with the keywords enabled. Setting the no_keywords config breaks compiling.

      Is there any way, to tell Qt/moc/whatever to ignore the slots variable in the third party library?

      Help is very much appreciated
      Sorut

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 22 Feb 2022, 14:25 last edited by
      #2

      @Sorut Maybe you could undefine the "slots" macro (#undef slots) before including that header file and then defining it again after the include.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S Offline
        S Offline
        Sorut
        wrote on 23 Feb 2022, 05:38 last edited by
        #3

        How do I redefine the slots Macro?

        J 1 Reply Last reply 23 Feb 2022, 05:44
        0
        • S Sorut
          23 Feb 2022, 05:38

          How do I redefine the slots Macro?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 23 Feb 2022, 05:44 last edited by
          #4

          @Sorut You could try to include qobjectdefs.h (corelib/kernel/) where slots macro is defined.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sorut
            wrote on 23 Feb 2022, 05:48 last edited by Sorut
            #5

            I tried:
            #undef slots

            <fancy includes>

            #define slots Q_SLOTS

            So far the compiler is satisfied. I'll run some tests if it works at the end.

            1 Reply Last reply
            1
            • S Offline
              S Offline
              Sorut
              wrote on 23 Feb 2022, 06:19 last edited by
              #6

              Seems to work nice.

              @jsulm Thank you very much for your help.

              1 Reply Last reply
              0

              4/6

              23 Feb 2022, 05:44

              • Login

              • Login or register to search.
              4 out of 6
              • First post
                4/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved