manfonly 发表于 2006-10-1 15:06:54

如何在debian上安装qt3开发环境

昨天用apt-get安装qt3开发环境,搞了一天,还是不能编译文档1里面helloworld,有哪位大侠帮我看看还少了什么。(我现在可以进kde,qmake已经安装,下面是一些shell输出)


>dpkg -l | grep qt3
ii libqt3-compat- 3.3.4-3 Qt 1.x and 2.x compatibility includes
ii libqt3-headers 3.3.4-3 Qt3 header files
ii libqt3-i18n 3.3.4-3 i18n files for Qt3 library
ii libqt3-mt-dev 3.3.4-3 Qt development files (Threaded)
ii libqt3c102 3.3.4-3 Qt GUI Library, Version 3
ii libqt3c102-mt 3.3.4-3 Qt GUI Library (Threaded runtime version), V
ii qt3-assistant 3.3.4-3 The Qt3 assistant application
ii qt3-designer 3.3.4-3 Qt3 Designer
ii qt3-dev-tools 3.3.4-3 Qt3 development tools
ii qt3-dev-tools- 3.3.4-3 Conversion utilities for Qt3 development
ii qt3-dev-tools- 3.3.4-3 Tools to develop embedded Qt applications
ii qt3-doc 3.3.4-3 Qt3 API documentation
ii qt3-examples 3.3.4-3 Examples for Qt3
ii qt3-linguist 3.3.4-3 The Qt3 Linguist
ii qt3-qtconfig 3.3.4-3 The Qt3 Configuration Application

编译的输出:
$~/workplace/qt$ qmake -project
$~/workplace/qt$ ls
helloworld.cpp packages qt.pro
$~/workplace/qt$ qmake
$~/workplace/qt$ ls
helloworld.cpp Makefile packages qt.pro
$~/workplace/qt$ make

g++ -o qt helloworld.o -L/usr/X11R6/lib -lXext -lX11 -lm
helloworld.o(.text+0x30): In function `main':
: undefined reference to `QApplication::QApplication(int&, char**)'
helloworld.o(.text+0x41): In function `main':
: undefined reference to `QString::QString(char const*)'
helloworld.o(.text+0x5f): In function `main':
: undefined reference to `QPushButton::QPushButton(QString const&, QWidget*, char const*)'
helloworld.o(.text+0x74): In function `main':
: undefined reference to `QString::shared_null'
helloworld.o(.text+0x7e): In function `main':
: undefined reference to `QStringData::deleteSelf()'
helloworld.o(.text+0xa6): In function `main':
: undefined reference to `QPushButton::resize(int, int)'
helloworld.o(.text+0xb2): In function `main':
: undefined reference to `QApplication::setMainWidget(QWidget*)'
helloworld.o(.text+0xba): In function `main':
: undefined reference to `QWidget::show()'
helloworld.o(.text+0xc2): In function `main':
: undefined reference to `QApplication::exec()'
helloworld.o(.text+0xcc): In function `main':
: undefined reference to `QPushButton::~QPushButton ()'
helloworld.o(.text+0xd4): In function `main':
: undefined reference to `QApplication::~QApplication ()'
helloworld.o(.text+0x104): In function `main':
: undefined reference to `QApplication::~QApplication ()'
helloworld.o(.text+0x112): In function `main':
: undefined reference to `QString::shared_null'
helloworld.o(.text+0x11c): In function `main':
: undefined reference to `QStringData::deleteSelf()'
helloworld.o(.text+0x128): In function `main':
: undefined reference to `QPushButton::~QPushButton ()'
helloworld.o(.gnu.linkonce.r._ZTV6QGList+0xc): undefined reference to `QGList::clear()'
helloworld.o(.gnu.linkonce.r._ZTV6QGList+0x10): undefined reference to `QGList::~QGList ()'
helloworld.o(.gnu.linkonce.r._ZTV6QGList+0x14): undefined reference to `QGList::~QGList ()'
helloworld.o(.gnu.linkonce.r._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)'
helloworld.o(.gnu.linkonce.r._ZTV6QGList+0x20): undefined reference to `QGList:areItems(void*, void*)'
helloworld.o(.gnu.linkonce.r._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
helloworld.o(.gnu.linkonce.r._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
helloworld.o(.gnu.linkonce.r._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection'
collect2: ld returned 1 exit status
make: *** 错误 1

mylxiaoyi 发表于 2006-10-2 12:03:10

helloworld程序是Qt几的语法?

cavendish 发表于 2006-10-17 21:49:22

debian我没用过
你的hello world源代码呢?

建议直接使用qt下的examples
另外自己手动编译qt
对自己学习还是很有帮助的
页: [1]
查看完整版本: 如何在debian上安装qt3开发环境