PDA

View Full Version : Using QWT with QT-Creator on Ubuntu 10.10



ufechner
11th June 2011, 17:51
Hello,
I successfully installed QWT and QTCreator on Ubuntu 10.10,
using the official packages:


sudo apt-get install libqwt5-qt4-dev
sudo apt-get install libqwt5-doc
sudo apt-get install qtcreator

This includes QT 4.7.0 and QT Creator 2.0.1.
I succesfully compiled the examples:


cd ~
mkdir 00QT-Software
cp -R /usr/share/doc/libqwt5-doc/examples .
chown -R <your-user-name> examples
cd examples
gedit examplex.pri

> within this file, change the first line
> after the comments to:
> QWT_ROOT = .
> save the file and exit the editor

qmake
make

cd simple_plot/examples/bin
./simple

Now I try to build a QWT application with QTCreator. I have the QWT plugin,
I could create a simple form with a QWTPlot widget on it.

But if try to compile, I get the message:



ufechner@dell-laptop:~/00QT-Software/FirstQWT$ qmake
ufechner@dell-laptop:~/00QT-Software/FirstQWT$ make
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../examples/include -I. -I. -o mainwindow.o mainwindow.cpp
In file included from mainwindow.cpp:2:
ui_mainwindow.h:24: fatal error: qwt_plot.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
make: *** [mainwindow.o] Fehler 1
ufechner@dell-laptop:~/00QT-Software/FirstQWT$

Any idea, how to fix this? I suppose, that I have to add something to my
FirstQWT.pro file, but what?


#-------------------------------------------------
#
# Project created by QtCreator 2011-06-10T15:34:00
#
#-------------------------------------------------
# include( qwtconfig.pri )

QT += core gui

QWT_DIR = ../examples

INCLUDEPATH += $$QWT_DIR/include

TARGET = FirstQWT
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui

Any suggestions welcome.

Best regards:

Uwe Fechner, TU Delft

ufechner
11th June 2011, 22:02
I solved this issue, but I don't know, whether it is the best approach:

First I created a symbolic link:


sudo ln -s /usr/lib/libqwt-qt4.so /usr/lib/libqwt.so


Then I changed the file FirstQWT.pro like this:


#-------------------------------------------------
#
# Project created by QtCreator 2011-06-10T15:34:00
#
#-------------------------------------------------
# include( qwtconfig.pri )

QT += core gui

INCLUDEPATH += /usr/include/qwt-qt4
LIBS += /usr/lib/libqwt.so

TARGET = FirstQWT
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui


If this is the correct approach, why is it nowhere documented?

Best regards:

Uwe Fechner