error: expected unqualified-id before '=' token

This is a discussion on error: expected unqualified-id before '=' token within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by gcc error: expected unqualified-id before '=' token at line: Q_DECLARE_METATYPE(QSet<QAccessible::Method>) Q_DECLARE_METATYPE is macro expanded as: Code: #define ...

  1. #1
    Banned
    Join Date
    May 2008
    Location
    Four Dots Planet
    Posts
    72

    error: expected unqualified-id before '=' token

    Quote Originally Posted by gcc
    error: expected unqualified-id before '=' token
    at line: Q_DECLARE_METATYPE(QSet<QAccessible::Method>)

    Q_DECLARE_METATYPE is macro expanded as:
    Code:
    #define Q_DECLARE_METATYPE(TYPE) \
    template <> \
    struct QMetaTypeId< TYPE > \
    { \
        enum { Defined = 1 }; \
        static int qt_metatype_id() \
        { \
            static QBasicAtomic id = Q_ATOMIC_INIT(0); \
            if (!id) \
               id = qRegisterMetaType< TYPE >(#TYPE); \
           return id; \
        } \
    };
    i am compiling qt-4.3.0 using XCode 3.0 gcc 4.0.1 on Leopard.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,338
    Replace Q_DECLARE_METATYPE(QSet<QAccessible::Method>) with the actual code at the place where it fails. Then you'll have a better idea of which line the error refers to.

    It sounds like QBasicAtomic or Q_ATOMIC_INIT or qRegisterMetaType is not declared.

  3. #3
    Banned
    Join Date
    May 2008
    Location
    Four Dots Planet
    Posts
    72
    yes if all else failed i will try that there is some headers file confusion as i can guess from your hint that may be a few definitions are missing here thanks daved.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 09:33 AM
  2. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. Parsing and Tokens (strtok)
    By readerwhiz in forum C Programming
    Replies: 6
    Last Post: 04-22-2002, 09:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21