Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Expected unqualified-id before 'int' with Qt5.3 only for bool signal and slot
Forum Updated to NodeBB v4.3 + New Features

Expected unqualified-id before 'int' with Qt5.3 only for bool signal and slot

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 3.9k Views 1 Watching
  • 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.
  • Y Offline
    Y Offline
    ycyclop
    wrote on last edited by
    #1

    I have some code that compile and works correctly on Windows but when I try to compile it on linux with scons I get this error on the generated moc files.
    The moc files are created with Qt 5.3 (I checked that they are accidently created by an older Qt version that is also installed, which means my QTDIR, QTLIB & QTINC are defined correctly) and the signal/slot tables look correct and nothing strange about them except that the line:
    QMetaType::Void, QMetaType::Bool, 3,
    for a slot or signal generate an error. The type "QMetaType::Bool" is not identified by the g++ compiler for some reason
    Any idea what can be causing this?

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      ycyclop
      wrote on last edited by
      #2

      The problem is because of the xlib.h which defines Bool
      The solution is after all the includes do #undef Bool

      #include <Qt stuff>
      #include <you stuff that include xlib.h>

      #undef Bool

      class
      {
      }

      This is ugly but so far this is the only solution I found. This will cause the need to include files in the .cpp in a specific order sometimes since in some cases you'll need the Bool as defined in the xlib.h

      1 Reply Last reply
      2

      • Login

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