• 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 

    代码风格就是程序员的脸面,要把生命中所有的才华、心血都倾注在code的字里行间。
  • 相关阅读:
    jenkins集成python时出现"Non-ASCII character 'xe6' in file"错误解决方法
    【转】/bin/bash^M: bad interpreter: No such file or directory
    解决Jenkins中执行jmeter脚本后不能发报告(原报告被覆盖、新报告无法保存)的问题
    【转】shell脚本中如何传入参数
    Hibernate学习笔记
    struts2学习笔记
    oracle表空间相关SQL语句
    javaMail
    Mysql 5.7.7
    设计模式之享元模式
  • 原文地址:https://www.cnblogs.com/bhss/p/4992573.html
Copyright © 2020-2023  润新知