[QScintilla] link error moc file from subclass QsciScintilla

KlausDre klausdre at googlemail.com
Wed Mar 7 19:38:33 GMT 2007


Hi Kor,

I got the same error because I forgot to define QSCINTILLA_DLL
in my project.

Greetings
   Klaus


Kor de Jong schrieb:
> 
> Hi all,
> 
> I am creating two plugins for use in Qt's designer. One plugin is a 
> subclass of QTableWidget (table) and the other is a subclass of 
> QscScintilla (editor).
> 
> I get a link error on the module generated by moc of the editor class:
> 
> moc_MyEditor.obj : error LNK2001: unresolved external symbol "public: 
> static struct QMetaObject const QsciScintilla::staticMetaObject" 
> (?staticMetaObject at QsciScintilla@@2UQMetaObject@@B)
> 
> Linking succeeds if I remove the reference to QOBJECT from the editor 
> module and skip moc file generation for the editor. I can see both 
> plugins in designer, except the editor presents itself as a QscScintilla 
> object instead of a MyEditor object. I guess this is due to the fact 
> that no meta information about the editor class is available.
> 
> I have the feeling something obvious is going wrong, but I can't seem to 
> find the problem.
> 
> The header files of the table class and the editor subclass are the 
> same, except for the base class they inherit from. Apart from the 
> constructors I haven't implemented any members yet. Here's the relevant 
> part of the class definition:
> 
> class __declspec(dllexport) MyEditor: public QsciScintilla {
> 
> private:
> 
>   Q_OBJECT
> 
> Public:
> 
>   MyEditor(QWidget* parent=0);
> 
> };
> 
> Again, the table class definition is very similar.
> 
> Some context:
> qt-4.2.2
> qscintilla-1.72-gpl-2-snapshot-20070304
> Windows XP
> MS Visual Studio 2005, SP1
> 
> Any hints are greatly appreciated.
> 
> Best regards,
> Kor de Jong
> 
> 
> ------------------------------------------------------------------------
> Dit bericht is verzonden via mijndomein.nl <http://www.mijndomein.nl>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> QScintilla mailing list
> QScintilla at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/qscintilla



More information about the QScintilla mailing list