bhss

4、树莓派的中文:安装ftp,安装gcc,安装qt,编译qt程序,运行qt界面程序

本博文仅作本人操作过程的记录,留作备忘。自强不息 QQ1222698

 

1、安装FTP:sudo apt-get install vsftpd

2、配置FTP,修改,/etc/vsftpd.conf

#write_enable=YES 去掉#号

重启ftp服务,sudo service vsftpd restart

3、安装qt4,sudo apt-get install gcc g++ qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer

4、qt安装后,就可以编译qt程序了。

在win7下安装qt5,地址http://www.qt.io/download/

a、选择Open source distribution under a LGPL or GPL license,再选择yes,再选择yes,再选择yes。

b、我选择的是Qt 5.5.1 for Windows 64-bit (VS 2013, 823 MB),地址http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013_64-5.5.1.exe,安装就简单了。

c、可以不下载这个,下载Linux版的QT,安装在Debian系统下,用于交叉编译,我选择的是Qt 5.5.1 for Linux 32-bit (634 MB),地址http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x64-5.5.1.run

d、在win7下打开qt5,做一个简单的小程序,编译运行没有问题。我的项目叫Hello,运行起来。

5、用ftp把文件夹上传到树莓派中,在树莓派的命令行下编译,ssh下也行

命令:qmake Hello.pro

命令:make

 

pi@raspberrypi:~/soft$ cd Hello/
pi@raspberrypi:~/soft/Hello$ ls
Hello.pro Hello.pro.user main.cpp mainwindow.cpp mainwindow.h mainwindow.ui
pi@raspberrypi:~/soft/Hello$ qmake Hello.pro
pi@raspberrypi:~/soft/Hello$ make
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic mainwindow.ui -o ui_mainwindow.h
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o mainwindow.o mainwindow.cpp
/usr/lib/arm-linux-gnueabihf/qt4/bin/moc -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. mainwindow.h -o moc_mainwindow.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o moc_mainwindow.o moc_mainwindow.cpp
g++ -Wl,-O1 -o Hello main.o mainwindow.o moc_mainwindow.o -L/usr/lib/arm-linux-gnueabihf -lQtGui -lQtCore -lpthread
pi@raspberrypi:~/soft/Hello$

 

6、树莓派桌面下执行:./hello

 

 

by自强不息 qq1222698,2015年11月26日15:36:18 

分类:

技术点:

相关文章: