首页| 论坛| 消息

标题:【提问】各位qtopia高手,请教一个问题
作者:wlg7705
日期:2005-09-03 10:17
内容:

我写了一个qtopia的应用程序,源码见附件,make提示错误如下:
ls
hello_base.cpphello_base.uihello.desktophello.proMakefile
hello_base.h hello.cpp hello.h main.cpp Makefile.in
# make
gcc -L/friendly-arm/x86-qtopia/qtopia/lib -Wl,-rpath,/friendly-arm/x86-qtopia/qtopia/lib -L/friendly-arm/x86-qtopia/qt/lib -Wl,-rpath,/friendly-arm/x86-qtopia/qt/lib -o /friendly-arm/x86-qtopia/qtopia/bin/hello .obj/linux-generic-g++//hello.o .obj/linux-generic-g++//main.o .obj/linux-generic-g++//hello_base.o .obj/linux-generic-g++//moc_hello_base.o-lqpe -lqtopia -lqte
.obj/linux-generic-g++//hello.o(.text+0x19): In function `HelloForm::HelloForm(QWidget*, char const*, unsigned)':
: undefined reference to `vtable for HelloForm'
.obj/linux-generic-g++//hello.o(.text+0x20): In function `HelloForm::HelloForm(QWidget*, char const*, unsigned)':
: undefined reference to `vtable for HelloForm'
.obj/linux-generic-g++//hello.o(.text+0x45): In function `HelloForm::HelloForm(QWidget*, char const*, unsigned)':
: undefined reference to `vtable for HelloForm'
.obj/linux-generic-g++//hello.o(.text+0x4c): In function `HelloForm::HelloForm(QWidget*, char const*, unsigned)':
: undefined reference to `vtable for HelloForm'
.obj/linux-generic-g++//hello.o(.text+0x63): In function `HelloForm::~HelloForm ()':
: undefined reference to `vtable for HelloForm'
.obj/linux-generic-g++//hello.o(.text+0x6a): more undefined references to `vtable for HelloForm' follow
.obj/linux-generic-g++//hello.o(.text+0x205): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init()'
.obj/linux-generic-g++//hello.o(.text+0x230): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init ()'
collect2: ld returned 1 exit status
make: ** ..


#1 [XChinux 09-03 10:40]
是不是你类定义不正确?上面那么多undefined reference
#2 [ryan 09-09 10:10]
1. make clean
2. 设置好环境变量,然后重新生成 你的helloform.
和cpp文件, tmake -
Makefile *.pro
3. make
主要问题应该是你的Makefile和使用的uic,moc,tmake是不是兼容这个qte版本.
#3 [olivercheung 05-15 15:19]
我也遇到了类似的问题,能说详细点吗
#4 [shiroki 05-20 13:54]
附件在哪儿呢?

回复 发表
主题 版块