[root@dyH qt-embedded-linux-opensource-src-4.5.3]# cd /usr/local/Trolltech/QtEmbedded-4.5.3-arm/demos/ [root@dyH demos]# mkdir hello [root@dyH demos]# cd hello
[root@dyH hello]# vim hello.cpp #include <QApplication> #include <QLabel> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLabel *label = new QLabel("Hello Qt!"); label->show(); return app.exec(); }
[root@dyH hello]# qmake -project -bash: qmake: command not found
[root@dyH hello]# ls /usr/local/Trolltech/QtEmbedded-4.5.3-arm/bin/qmake /usr/local/Trolltech/QtEmbedded-4.5.3-arm/bin/qmake [root@dyH hello]# echo "PATH=/usr/local/Trolltech/QtEmbedded-4.5.3-arm/bin:$PATH" >> ~/.bashrc [root@dyH hello]# . ~/.bashrc [root@dyH hello]# echo $PATH /usr/local/Trolltech/QtEmbedded-4.5.3-arm/bin:/usr/local/arm/4.3.2/bin/ :/usr/bin:/bin:/sbin:/usr/sbin:/sbin:/usr/sbin:/root/bin
[root@dyH hello]# qmake -project [root@dyH hello]# qmake -project [root@dyH hello]# ll total 8 -rw-r--r--. 1 root root 202 Sep 8 09:30 hello.cpp -rw-r--r--. 1 root root 298 Sep 8 09:39 hello.pro
[root@dyH hello]# qmake hello.pro [root@dyH hello]# ll total 16 -rw-r--r--. 1 root root 202 Sep 8 09:30 hello.cpp -rw-r--r--. 1 root root 298 Sep 8 09:39 hello.pro -rw-r--r--. 1 root root 6437 Sep 8 09:42 Makefile
[root@dyH hello]# make 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../../mkspecs/qws/linux-arm-g++ -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include/QtGui -I../../include -I. -I. -o hello.o hello.cpp arm-linux-g++ -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -o hello hello.o -L/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -lQtNetwork -lQtCore -lm -lrt -ldl -lpthread [root@dyH hello]# ll total 28 -rwxr-xr-x. 1 root root 7717 Sep 8 09:44 hello -rw-r--r--. 1 root root 202 Sep 8 09:30 hello.cpp -rw-r--r--. 1 root root 2716 Sep 8 09:44 hello.o -rw-r--r--. 1 root root 298 Sep 8 09:39 hello.pro -rw-r--r--. 1 root root 6437 Sep 8 09:42 Makefile
[root@dyH hello]# ./hello -bash: ./hello: cannot execute binary file [root@dyH hello]# file hello hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped