PDA

View Full Version : Qsciscintilla linkerror LNK2001: sÃ*mbolo externo "public: static struct QMetaObject



ilermar
14th March 2012, 20:57
hi,


I´m trying to use qsciscintilla in my project, i create a new class EditWindow that inherits from QsciScintilla.

Environment
Windows 7
MVS 2010 with qt add-in
Qt 4.8.0
QsciScintilla 2.6.1

When i compile my project i get this error


error LNK2001: sÃ*mbolo externo "public: static struct QMetaObject const QsciScintilla::staticMetaObject" (?staticMetaObject@QsciScintilla@@2UQMetaObject@@B ) sin resolver C:\...Editor\moc_EditWindow.obj


Here is my EditWindow class



EditWindow.h

#include <Qsci/qsciscintilla.h>
#include <Qsci/qscilexer.h>

class EditWindow :
public QsciScintilla
{
Q_OBJECT

public:
EditWindow( QWidget *parent, const QString &filePath = "" );
~EditWindow( );

private:
QString mFileName; /**< The file name with the absolute path.*/
QsciLexer *mLexer; /**< Lexer used by scintilla. It depends of the type of file*/
};

EditWindow.cpp

#include "EditWindow.h"


EditWindow::EditWindow( QWidget *parent, const QString &filename )
: QsciScintilla( parent )
{
mFile = filename;
............
}


If somebody know or have an idea of how fix this :confused:

mentalmushroom
15th March 2012, 10:05
I am not sure what QscScintilla is. If it is a dll, make sure you linked the lib file. Also the following link may help: http://www.riverbankcomputing.com/pipermail/qscintilla/2007-March/000034.html

ilermar
16th March 2012, 17:28
I am not sure what QscScintilla is. If it is a dll, make sure you linked the lib file. Also the following link may help: http://www.riverbankcomputing.com/pipermail/qscintilla/2007-March/000034.html

Thanks mentalmushroom QscinScintilla is a dll but i already linked the .lib for the debug and release version ...

mentalmushroom
17th March 2012, 09:31
I think, you forgot to define QSCINTILLA_DLL. Also if you are writing your own lexer, e.g. for some another programming language, you should define SCI_LEXER, but if you don't it is not needed. I've tried to build a project similar to yours and it succeeded.