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 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

    jsulmJ 1 Reply Last reply
    0
    • S Sorut

      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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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 last edited by
        #3

        How do I redefine the slots Macro?

        jsulmJ 1 Reply Last reply
        0
        • S Sorut

          How do I redefine the slots Macro?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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 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 last edited by
              #6

              Seems to work nice.

              @jsulm Thank you very much for your help.

              1 Reply Last reply
              0

              • Login

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