банальнейший пример не могу откомпилировать:
#include <qapplication.h>
#include <qpushbutton.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Привет, Мир!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec();
}
====================
[max@localhost test]$ gcc -o myapp myapp.cpp
myapp.cpp:1:26: qapplication.h: No such file or directory
myapp.cpp:2:25: qpushbutton.h: No such file or directory
myapp.cpp: In function `int main(int, char**)':
myapp.cpp:6: `QApplication' undeclared (first use this function)
myapp.cpp:6: (Each undeclared identifier is reported only once for each function it appears in.)
myapp.cpp:6: parse error before `(' token
myapp.cpp:8: `QPushButton' undeclared (first use this function)
такая херня.. значит типа пакет не нашел... ладно так тебе :
[max@localhost test]$ gcc -o myapp myapp.cpp -I/usr/X11R6/include -I$QTDIR/include -L/usr/X11R6/lib -L$QTDIR/lib -Iqt
/home/max/tmp/ccPl0YwA.o: In function `main':
/home/max/tmp/ccPl0YwA.o(.text+0x23): undefined reference to `QApplication::QApplication[in-charge](int&, char**)'
/home/max/tmp/ccPl0YwA.o(.text+0x3b): undefined reference to `QString::QString[in-charge](char const*)'
/home/max/tmp/ccPl0YwA.o(.text+0x51): undefined reference to `QPushButton::QPushButton[in-charge](QString const&, QWidget*, char const*)'
/home/max/tmp/ccPl0YwA.o(.text+0xa4): undefined reference to `QPushButton::resize(int, int)'
/home/max/tmp/ccPl0YwA.o(.text+0xba): undefined reference to `QApplication::setMainWidget(QWidget*)'
/home/max/tmp/ccPl0YwA.o(.text+0xcc): undefined reference to `QWidget::show()'
/home/max/tmp/ccPl0YwA.o(.text+0xdb): undefined reference to `QApplication::exec()'
/home/max/tmp/ccPl0YwA.o(.text+0xf3): undefined reference to `QPushButton::~QPushButton [in-charge]()'
/home/max/tmp/ccPl0YwA.o(.text+0x102): undefined reference to `QApplication::~QApplication [in-charge]()'
/home/max/tmp/ccPl0YwA.o(.text+0x12e): undefined reference to `QPushButton::~QPushButton [in-charge]()'
/home/max/tmp/ccPl0YwA.o(.text+0x151): undefined reference to `QApplication::~QApplication [in-charge]()'
/home/max/tmp/ccPl0YwA.o: In function `QString::~QString [in-charge]()':
/home/max/tmp/ccPl0YwA.o(.gnu.linkonce.t._ZN7QStringD1Ev+0x21): undefined reference to `QString::shared_null'
/home/max/tmp/ccPl0YwA.o(.gnu.linkonce.t._ZN7QStringD1Ev+0x30): undefined reference to `QStringData::deleteSelf()'
/home/max/tmp/ccPl0YwA.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
что за ерунда? ....
а как вод qmake у меня Makefile делал а потом всеравно при компиляции такая же ерунда
![Sad :(](./images/smilies/icon_sad.gif)