标题:请教应用程序出现的问题
作者:陈媛媛
日期:2006-12-03 19:40
内容:
我成功的在板子上移植了一个编译好的浏览界面的程序,后来想在里面添加一些东西,但是编译的出现下面的问题,清高人指点一下,好吗? 非常感谢
I/usr/local/arm/qt/include -I/usr/local/arm/qtopia/include -o moc_mainwindow.o moc_mainwindow.cpp
/usr/local/arm/qt/bin/moc qfileiconview.h -o moc_qfileiconview.cpp
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/usr/local/arm/qt/include -I/usr/local/arm/qtopia/include -o moc_qfileiconview.o moc_qfileiconview.cpp
arm-linux-gcc -o file filebrowser.o main.o qfileiconview.o moc_filebrowser.o moc_mainwindow.o moc_qfileiconview.o -L/opt/host/armv4l/lib -L/usr/local/arm/qtopia/lib -L/usr/local/arm/qt/lib -lm -lqpe -lqtopia -lqte -luuid
/opt/host/armv4l/armv4l-unknown-linux/bin/ld: warning: libuuid.so.1, needed by /usr/local/arm/qtopia/lib/libqtopia.so, not found (try using --rpath)
main.o: In function `main':
main.o(.text+0x34): undefined reference to `FileMainWindow::FileMainWindow(void)'
main.o(.text+0x34): relocation truncated to fit: R_ARM_PC24 FileMainWindow::FileMainWindow(void)
main.o(.text+0xac): undefined reference to `FileMainWindow::show(void)'
main.o(.text+0xac): relocation truncated to fit: R_ARM_PC24 FileMainWindow::show(void)
moc_mainwindow.o(.rodata+0x20): undefined reference to `FileMainWindow::directoryChanged(QString const &)'
moc_mainwindow.o(.rodata+0x28): undefined reference to `FileMainWindow::slotStartReadDir(int)'
moc_mainwindow.o(.rodata+0x30): undefined reference to `FileMainWindow::slotReadNextDir(void)'
moc_mainwindow.o(.rodata+0x38): undefined reference to `FileMainWindow::slotReadDirDone(void)'
moc_mainwindow.o(.rodata+0x40): undefined reference to `FileMainWindow::cdUp(void)'
moc_mainwindow.o(.rodata+0x48): undefined reference to `FileMainWindow::newFolder(void)'
moc_mainwindow.o(.rodata+0x50): undefined reference to `FileMainWindow::changePath(QString const &)'
moc_mainwindow.o(.rodata+0x58): undefined reference to `F ..
#1 [shiroki 12-04 15:27]
从你的log信息里看到了两个错误:
1、 /opt/host/armv4l/armv4l-unknown-linux/bin/ld: warning: libuuid.so.1, needed by /usr/local/arm/qtopia/lib/libqtopia.so, not found (try using --rpath)
这个uuid的库交叉编译好了吗? 要放在toolchain的targetfs路径下,一般是toolchain/arm-linux/lib, 你可以搜一下, 找找像libpthread之类的库放在哪里了, cp到相同位置
2、 undefined reference
从错误信息来看,那些函数应该是在mainwindow.cpp里的吧?
但是你这个编译的命令行里没有mainwindow.o......
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/usr/local/arm/qt/include -I/usr/local/arm/qtopia/include -o moc_qfileiconview.o moc_qfileiconview.cpp
arm-linux-gcc -o file filebrowser.o main.o qfileiconview.o moc_filebrowser.o moc_mainwindow.o moc_qfileiconview.o -L/opt/host/armv4l/lib -L/usr/local/arm/qtopia/lib -L/usr/local/arm/qt/lib -lm -lqpe -lqtopia -lqte -luuid
这个问题比较怪,是不是pro文件没写好?
#2 [陈媛媛 12-06 09:53]
问题解决,谢谢斑竹阿