Results 1 to 4 of 4

Thread: Qsciscintilla linkerror LNK2001: sÃ*mbolo externo "public: static struct QMetaObject

  1. #1
    Join Date
    Jan 2012
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qsciscintilla linkerror LNK2001: sÃ*mbolo externo "public: static struct QMetaObject

    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

    Qt Code:
    1. EditWindow.h
    2.  
    3. #include <Qsci/qsciscintilla.h>
    4. #include <Qsci/qscilexer.h>
    5.  
    6. class EditWindow :
    7. public QsciScintilla
    8. {
    9. Q_OBJECT
    10.  
    11. public:
    12. EditWindow( QWidget *parent, const QString &filePath = "" );
    13. ~EditWindow( );
    14.  
    15. private:
    16. QString mFileName; /**< The file name with the absolute path.*/
    17. QsciLexer *mLexer; /**< Lexer used by scintilla. It depends of the type of file*/
    18. };
    19.  
    20. EditWindow.cpp
    21.  
    22. #include "EditWindow.h"
    23.  
    24.  
    25. EditWindow::EditWindow( QWidget *parent, const QString &filename )
    26. : QsciScintilla( parent )
    27. {
    28. mFile = filename;
    29. ............
    30. }
    To copy to clipboard, switch view to plain text mode 

    If somebody know or have an idea of how fix this

  2. #2
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qsciscintilla linkerror LNK2001: sÃ*mbolo externo "public: static struct QMetaObje

    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/pi...ch/000034.html

  3. #3
    Join Date
    Jan 2012
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qsciscintilla linkerror LNK2001: sÃ*mbolo externo "public: static struct QMetaObje

    Quote Originally Posted by mentalmushroom View Post
    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/pi...ch/000034.html
    Thanks mentalmushroom QscinScintilla is a dll but i already linked the .lib for the debug and release version ...

  4. #4
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qsciscintilla linkerror LNK2001: sÃ*mbolo externo "public: static struct QMetaObje

    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.

Similar Threads

  1. Replies: 4
    Last Post: 9th May 2016, 13:30
  2. Replies: 5
    Last Post: 6th December 2011, 11:24
  3. Replies: 5
    Last Post: 24th May 2010, 22:20
  4. Replies: 16
    Last Post: 23rd May 2008, 11:12
  5. Static field and public method
    By probine in forum General Programming
    Replies: 1
    Last Post: 5th March 2006, 12:02

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.