Results 1 to 3 of 3

Thread: Problem with QScintilla

  1. #1
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QScintilla

    Hi programmers! I'm a new member in this (fantastic) community. I started to learn Qt some weeks ago, and now I have a problem. I want to develop a little IDE for C/C++, and my friends recommend me that I'd use QScintilla for the central editor widget. Well, I download and install it, compile the example and all works fine, but when I make a new application in other directory, I found this problem:
    this is an trivial example:
    Qt Code:
    1. #include <QtGui>
    2. #include <QApplication>
    3. #include <Qsci/qsciscintilla.h>
    4.  
    5. int main (int a,char* b[])
    6. {
    7. QApplication app(a,b);
    8. QsciScintilla *textEdit = new QsciScintilla;
    9. textEdit->show();
    10. return app.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 


    the problem is when I run make, this is the error message:

    main.o: In function `main':
    main.cpp: (.text+0x44): undefined reference to `QsciScintilla::QsciScintilla(QWidget*)'
    collect2: ld returned 1 exit status

    the make rules for compiling are the following:

    g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
    g++ -Wl,-O1 -o application main.o -L/usr/lib -lQtGui -lQtCore -lpthread

    I think this error occurs due to the linker cannot find the dynamic library of QScintilla. The headers files are good placing.

    Thanks and sorry for my horrible English XD


    Added after 13 minutes:


    Ok I found the solution: add LIBS += -lqscintilla to the .pro file
    Sorry, beginner fail. The thread can be closed.
    Last edited by dmr; 18th December 2012 at 01:24.

  2. The following user says thank you to dmr for this useful post:


  3. #2
    Join Date
    May 2013
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QScintilla

    Hi friends, I'm beginning whit qsciscintilla in debian and i have a problem whit the following fragment of code:

    #include <QtCore>
    #include <QApplication>
    #include <Qsci/qsciscintilla.h>
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QsciScintilla *textEdit = new QsciScintilla();
    textEdit->show();
    return a.exec();
    }

    It compiled but in run-time close the app and don't give me any msg. I add LIBS += -lqscintilla2 to my .pro but nothing, Could someone help me please?

  4. The following user says thank you to lorodriguez for this useful post:


  5. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with QScintilla

    lqscintilla2

    ^^ why is there a '2' on the end?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  6. The following user says thank you to amleto for this useful post:


Similar Threads

  1. Filll Edge QScintilla
    By wirasto in forum Qt Programming
    Replies: 0
    Last Post: 12th January 2011, 08:39
  2. QScintilla
    By drake1983 in forum Newbie
    Replies: 3
    Last Post: 1st November 2010, 14:01
  3. QScintilla
    By gerome69 in forum Qt Programming
    Replies: 2
    Last Post: 17th May 2009, 15:30
  4. qscintilla and markers
    By sawerset in forum Qt Programming
    Replies: 0
    Last Post: 17th February 2009, 22:39
  5. Documentation on QScintilla api files
    By davidh in forum Qt Programming
    Replies: 0
    Last Post: 29th November 2007, 19:36

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.