[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop
Subject:    Re: Qt related problem
From:       August =?iso-8859-1?Q?H=F6randl?= <august.hoerandl () gmx ! at>
Date:       2001-03-13 21:01:17
[Download RAW message or body]

Christian Menke wrote:
> =

> Hello!
> I'm having a bit of trouble getting applications compiled when I use qt=
=2E
> I've written a very small program that is meant to do nothing but be
> there and close when a button is clicked.
> My problem is that g++ cannot find qapplication.h and qpushbutton.h:
> =

> cmenke@davion:~/cpp$ g++ -o qt-sample qt-sample.cc
> qt-sample.cc:1: qapplication.h: No such file or directory
> qt-sample.cc:2: qpushbutton.h: No such file or directory
> cmenke@davion:~/cpp$ locate qapplication.h
> /usr/lib/qt2/include/qapplication.h
> =

> After having bugged a few people on IRC and found out that these includ=
es
> should be in /usr/lib/qt/ rather than /usr/lib/qt2/include, and thus I
> tried pointing g++ to the directory where my qapplication.h and stuff
> reside:
> =

> cmenke@davion:~/cpp$ g++ -I/usr/lib/qt2/include/ -o qt-sample qt-sample=
=2Ecc
> /tmp/cclt7tiz.o: In function `main':
> /tmp/cclt7tiz.o(.text+0x18): undefined reference to
> `QApplication::QApplication(int &, char **)'
> /tmp/cclt7tiz.o(.text+0x44): undefined reference to
> `QString::QString(char const *)'
> /tmp/cclt7tiz.o(.text+0x57): undefined reference to
> `QPushButton::QPushButton(QString const &, QWidget *, char const *)'
> =

> Well, that time, g++ obviously found the includes, but something....
> well... something went wrong again :-)

one of the troubles of c/c++: the header files don't include information
about the libraries to be included

with your -I.... g++ is able to find the header files - but g++ doesnt
know
which library to include

just add
 -L/usr/lib/qt2/lib  -lqt =

to the command line (-L path/to/library, -l name/of/library)

HTH
Gustl
-- =

August H=F6randl                  Printer not ready.
august.hoerandl@gmx.at          Could be a fatal error.
                                Have a pen handy?
                                --Pat Davis

-
to unsubscribe from this list send an email to kdevelop-request@kdevelop.org with the following body:
unsubscribe »your-email-address«

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic