Error: C++ requires a type specifier for all declarations



  • Hello!

    I have been trying to create a new class and I keep getting this error: C++ requires a type specifier for all declarations.

    I'm not sure really what it wants. Here is the code:
    @
    NBhistoryItem::NBhistoryItemN(QString hUrl, QString hTitle)
    {
    QString url = hUrl;
    QString title = hTitle;
    }
    @

    The error appears to be on line 1.

    Thanks!



  • The function NBhistoryItemN() has to have a return type (or void). Only the constructor and destructor have no return type.

    This looks like a typo.



  • indeed it is, how careless of me :P


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.