PDA

View Full Version : Problem with QScintilla



dmr
18th December 2012, 00:24
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:


#include <QtGui>
#include <QApplication>
#include <Qsci/qsciscintilla.h>

int main (int a,char* b[])
{
QApplication app(a,b);
QsciScintilla *textEdit = new QsciScintilla;
textEdit->show();
return app.exec();
}



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.

lorodriguez
8th May 2013, 16:37
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?

amleto
8th May 2013, 22:47
lqscintilla2

^^ why is there a '2' on the end?