首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > QT开发 >

请教大神们,为什么小弟我原程序能在QT Cteator生成可执行文件的,现在换了qte的qmake环境就出错了!

2012-03-14 
请问大神们,为什么我原程序能在QT Cteator生成可执行文件的,现在换了qte的qmake环境就出错了!!!我用Qt Cre

请问大神们,为什么我原程序能在QT Cteator生成可执行文件的,现在换了qte的qmake环境就出错了!!!
我用Qt Creator自带的qmake环境构建,工程文件能无错生成可执行文件。是x86版本的。

现在我想生成 ARM 版本的可执行文件放到开发板上运行。装了Qte4.4.3后,改了下qt版本,构建出错输出如下:

14:02:06: 为项目lincom执行构建步骤 ...
14:02:06: 配置没有改变, 跳过 qmake 步骤.
14:02:06: 正在启动 "/usr/bin/make" -w
 {1"?} {2?}
make: Entering directory `/home/lrr/lrr/lincom'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/bin/qmake -unix -o Makefile lincom.pro
make: Leaving directory `/home/lrr/lrr/lincom'
make: Entering directory `/home/lrr/lrr/lincom'
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/tmp/4.4.3/builddir/sdk/qtopiacore/target/mkspecs/qws/linux-arm-g++ -I. -I/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtCore -I/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtCore -I/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtNetwork -I/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtNetwork -I/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui -I/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui -I/tmp/4.4.3/builddir/sdk/qtopiacore/target/include -I. -I. -o mainwindow.o mainwindow.cpp
In file included from mainwindow.cpp:2:
ui_mainwindow.h: In member function 'void Ui_MainWindow::setupUi(QMainWindow*)':
ui_mainwindow.h:110: error: 'class QMainWindow' has no member named 'setCursor'
ui_mainwindow.h:110: error: no matching function for call to 'QCursor::QCursor(Qt::CursorShape)'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qcursor.h:64: note: candidates are: QCursor::QCursor()
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qcursor.h:58: note: QCursor::QCursor(const QCursor&)
ui_mainwindow.h:131: error: 'class QMainWindow' has no member named 'setAnimated'
ui_mainwindow.h:441: error: 'class QToolBar' has no member named 'setCursor'
ui_mainwindow.h:441: error: no matching function for call to 'QCursor::QCursor(Qt::CursorShape)'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qcursor.h:64: note: candidates are: QCursor::QCursor()
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qcursor.h:58: note: QCursor::QCursor(const QCursor&)
ui_mainwindow.h:450: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
ui_mainwindow.h:451: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
ui_mainwindow.h:452: error: 'class QMainWindow' has no member named 'setStatusBar'
mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
mainwindow.cpp:15: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_actionOpen_triggered()':
mainwindow.cpp:125: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_actionClose_triggered()':
mainwindow.cpp:149: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_actionAbout_triggered()':
mainwindow.cpp:156: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::readMyCom()':
mainwindow.cpp:192: error: invalid use of incomplete type 'struct QStatusBar'


/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::sendMsg()':
mainwindow.cpp:201: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_sendmsgBtn_clicked()':
mainwindow.cpp:221: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_clearUpBtn_clicked()':
mainwindow.cpp:240: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_actionClearBytes_triggered()':
mainwindow.cpp:252: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_obocheckBox_clicked()':
mainwindow.cpp:262: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp:266: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_actionSave_triggered()':
mainwindow.cpp:279: error: 'QFileDialog' has not been declared
mainwindow.cpp: In member function 'void MainWindow::on_actionAdd_triggered()':
mainwindow.cpp:315: error: 'QInputDialog' has not been declared
mainwindow.cpp:318: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_actionReadPortInterval_triggered()':
mainwindow.cpp:334: error: 'QInputDialog' has not been declared
mainwindow.cpp:341: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_actionLoadfile_triggered()':
mainwindow.cpp:348: error: 'QFileDialog' has not been declared
mainwindow.cpp:386: error: invalid use of incomplete type 'struct QStatusBar'
/tmp/4.4.3/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54: error: forward declaration of 'struct QStatusBar'
mainwindow.cpp: In member function 'void MainWindow::on_actionWriteToFile_triggered()':
mainwindow.cpp:399: error: 'QFileDialog' has not been declared
make: Leaving directory `/home/lrr/lrr/lincom'
make: *** [mainwindow.o] Error 1
14:02:12: 进程"/usr/bin/make"退出,退出代码 2 。
构建项目lincom 时发生错误 (目标: 桌面)
当执行构建步骤 'Make'时

[解决办法]
ui_mainwindow.h: In member function 'void Ui_MainWindow::setupUi(QMainWindow*)':
ui_mainwindow.h:110: error: 'class QMainWindow' has no member named 'setCursor'


版本不同,导致ui文件或者类接口不一致。

目标板子要跑什么版本, X86开发的时候也用什么版本吧。最好统一。
[解决办法]
那就安装一个4.4.3的x86库,然后开发。
应该不用全部重写,把没有的功能去掉或者替换。

最后再交叉编译。
[解决办法]
x86是为了开发调试方便,不是必须的。


我只是建议你统一开发环境和目标环境(的版本)。

现在你装的Qt SDK至少是4.6以上的,跟Qtopia差别很大,所以交叉编译的时候会出错。

热点排行