我直接新建一个目录chap03存放spreadsheet程序
使用的liunx系统为Fedora9
x86和arm交叉编译器应该都可以,因为hello word可以编译成功!
[root@localhost spreadsheet]# source /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/setQpeEnv
[root@localhost spreadsheet]# qmake -spec /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-arm-g++ -o Makefile *.pro
Project ERROR: Please set a target in /root/qt_study/chap03_arm/spreadsheet
//这里提示没有目标文件,在spreadsheet.pro最后一行添加TARGET = spreadsheet后重新qmake
[root@localhost spreadsheet]# qmake -spec /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-arm-g++ -o Makefile *.pro
[root@localhost spreadsheet]# make
/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/uic gotocelldialog.ui -o .ui/release-shared/gotocelldialog.h
/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/uic sortdialog.ui -o .ui/release-shared/sortdialog.h
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQT_NO_QWS_VFB -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"spreadsheet\" -DQTOPIA_TRTARGET=\"spreadsheet\" -DQT_NO_DEBUG -I/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-arm-g++ -I. -I. -I/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/include -I/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include -I.ui/release-shared/ -I. -I. -I.moc/release-shared/ -o .obj/release-shared/cell.o cell.cpp
cell.cpp:1:17: error: QtGui: No such file or directory
In file included from cell.cpp:3:
cell.h:4:28: error: QTableWidgetItem: No such file or directory
In file included from cell.cpp:3:
cell.h:7: error: expected class-name before '{' token
cell.h:11: error: ISO C++ forbids declaration of 'QTableWidgetItem' with no type
cell.h:11: error: expected ';' before '*' token
cell.h:12: error: expected ',' or '...' before '&' token
cell.h:12: error: ISO C++ forbids declaration of 'QVariant' with no type
cell.h:13: error: 'QVariant' does not name a type
cell.h:14: error: expected ',' or '...' before '&' token
cell.h:14: error: ISO C++ forbids declaration of 'QString' with no type
cell.h:15: error: 'QString' does not name a type
cell.h:19: error: 'QVariant' does not name a type
cell.h:20: error: 'QVariant' does not name a type
cell.h:21: error: 'QVariant' does not name a type
cell.h:22: error: 'QVariant' does not name a type
cell.h:24: error: 'QVariant' does not name a type
cell.cpp:10: error: expected constructor, destructor, or type conversion before '*' token
cell.cpp:15: error: expected ',' or '...' before '&' token
cell.cpp:15: error: ISO C++ forbids declaration of 'QVariant' with no type
cell.cpp: In member function 'void Cell::setData(int, int)':
cell.cpp:17: error: 'QTableWidgetItem' has not been declared
cell.cpp:17: error: 'value' was not declared in this scope
cell.cpp:18: error: 'Qt' has not been declared
cell.cpp: At global scope:
cell.cpp:15: warning: unused parameter 'QVariant'
cell.cpp:22: error: 'QVariant' does not name a type
cell.cpp:41: error: expected ',' or '...' before '&' token
cell.cpp:41: error: ISO C++ forbids declaration of 'QString' with no type
cell.cpp: In member function 'void Cell::setFormula(int)':
cell.cpp:43: error: 'Qt' has not been declared
cell.cpp:43: error: 'formula' was not declared in this scope
cell.cpp: At global scope:
cell.cpp:41: warning: unused parameter 'QString'
cell.cpp:46: error: 'QString' does not name a type
cell.cpp:56: error: 'QVariant' does not name a type
cell.cpp:58: error: 'QVariant' does not name a type
cell.cpp:89: error: 'QVariant' does not name a type
cell.cpp:113: error: 'QVariant' does not name a type
cell.cpp:141: error: 'QVariant' does not name a type
make: *** [.obj/release-shared/cell.o] 错误 1
[root@localhost spreadsheet]#
//错误提示没有QtGui路径,改如何加载,怎么才可以编译出.exe文件和.desktop文件?
谢谢