Решено: QT: не могу слинковать проект (Mandriva 2007, QT3)

Модератор: Модераторы разделов

Закрыто
finn
Сообщения: 2
ОС: Mandriva 2007

Решено: QT: не могу слинковать проект

Сообщение finn »

Давно собирался начать писать программы для X, вот и выдалась свободная минутка. Нашёл документацию, написал HelloWorld.
Дальше, вроде бы, как у всех начинающих: qmake -project && qmake && make
Компиляция проходит на ура, а вот линкования нет. Компилятор выдаёт следующие строки:
g++ -o qt main.o -L/usr/lib -lXext -lX11 -lm
main.o: In function `main':
main.cpp:(.text+0x34): undefined reference to `QApplication::QApplication(int&, char**)'
main.cpp:(.text+0x44): undefined reference to `QString::QString(char const*)'
main.cpp:(.text+0x6e): undefined reference to `QLabel::QLabel(QString const&, QWidget*, char const*, unsigned int)'
main.cpp:(.text+0x82): undefined reference to `QString::shared_null'
main.cpp:(.text+0x8c): undefined reference to `QStringData::deleteSelf()'
main.cpp:(.text+0x98): undefined reference to `QApplication::setMainWidget(QWidget*)'
main.cpp:(.text+0xa0): undefined reference to `QWidget::show()'
main.cpp:(.text+0xa8): undefined reference to `QApplication::exec()'
main.cpp:(.text+0xb2): undefined reference to `QLabel::~QLabel()'
main.cpp:(.text+0xba): undefined reference to `QApplication::~QApplication()'
main.cpp:(.text+0xe5): undefined reference to `QString::shared_null'
main.cpp:(.text+0xef): undefined reference to `QStringData::deleteSelf()'
main.cpp:(.text+0xf7): undefined reference to `QApplication::~QApplication()'
main.cpp:(.text+0x10d): undefined reference to `QLabel::~QLabel()'
main.o:(.rodata._ZTV6QGList[vtable for QGList]+0xc): undefined reference to `QGList::clear()'
main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x10): undefined reference to `QGList::~QGList()'
main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x14): undefined reference to `QGList::~QGList()'
main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x18): undefined reference to `QPtrCollection::newItem(void*)'
main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x20): undefined reference to `QGList::compareItems(void*, void*)'
main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
main.o:(.rodata._ZTV6QGList[vtable for QGList]+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
main.o:(.rodata._ZTI6QGList[typeinfo for QGList]+0x8): undefined reference to `typeinfo for QPtrCollection'
collect2: ld returned 1 exit status
make: *** [qt] Ошибка 1


Чувствую, что я где-то должен прописать путь к библиотекам QT, а вот где не знаю.
P.S.: Путь к заголовкам QT qmake пишет нормально (/usr/lib/qt3/include).
Помогите, пожалуйста. Не хочется оставаться вечно "консольным" или виндовым девелопером.
Спасибо сказали:
finn
Сообщения: 2
ОС: Mandriva 2007

Re: Решено: QT: не могу слинковать проект

Сообщение finn »

Пардон, поспешил. Сам нашёл решение проблемы.
Нужно в Makefile в переменную LIBS добавить -L/usr/lib/qt3/lib/ -lqt-mt
Думаю, тему можно закрывать.
Спасибо сказали:
Закрыто