wiki:FAQ_compilation

Version 2 (modified by Marek Kurdej, 11 years ago) ( diff )

Added: ComponentBase AFTER QObject

FAQ (1) -- common compilation errors

MSVC

ComponentBase should be inherited AFTER QObject

Error message

>moc_Component.cpp(63): error C2039: 'staticMetaObject' : is not a member of 'pacpus::ComponentBase'
>          ComponentBase.h(60) : see declaration of 'pacpus::ComponentBase'
>moc_Component.cpp(80): error C2039: 'qt_metacast' : is not a member of 'pacpus::ComponentBase'
>          ComponentBase.h(60) : see declaration of 'pacpus::ComponentBase'
>moc_Component.cpp(85): error C2039: 'qt_metacall' : is not a member of 'pacpus::ComponentBase'
>          ComponentBase.h(60) : see declaration of 'pacpus::ComponentBase'

Solution

Your class declaration should look like:

class Component
    : QObject
    , ComponentBase
{
};

GCC

Varia

FAQ -- Frequently Asked Questions

Note: See TracWiki for help on using the wiki.