/************************************************************************
* Building QT projects from the command line
* 说明:
* 很多时候都是通过Qtcreator进行项目的创建以及编译,但是有时候可能
* 会遇到一些编译小问题,这时候命令行创建工程、编译工程可以作为测试、验证
* 的一种手段。
*
* 2016-3-2 深圳 南山平山村 曾剑锋
***********************************************************************/ 一、参考文档:
Building QT projects from the command line
http://processors.wiki.ti.com/index.php/Building_QT_Projects 二、基本操作流程:
. After Installing your host Ubuntu and then the SDK on your host machine: [How to install Ubuntu and your SDK]
在你电脑上安装Ubuntu及SDK。
. Create a new directory on your Ubuntu 10.04 host.
在Ubuntu中创建一个目录,叫:hello-world。
user@user-desktop:~$mkdir hello-world
. Change to that directory
进入刚刚创建的目录 。
user@user-desktop:~$cd hello-world
. Source the environment setup to get access to qmake and the gcc compiler
导入环境变量,这样你才能够使用qmake和gcc编译器。
user@user-desktop:~/hello-world$ source /home/user/ti-sdk-am335x-evm-05.03.00.00/linux-devkit/environment-setup
. Create a new file: hello-world.cpp and copy in the following source code to hello-world.cpp
创建hello-world.cpp文件,并将以下源代码拷入文件中。
#include <QApplication>
#include <QLabel> int main(int argc, char **argv)
{
QApplication app(argc, argv); QLabel label("Hello World!");
label.show(); return app.exec();
}
. Execute the following commands: (If you already have a project file skip step )
执行以下命令:(如果你已经有一个工程项目文件,请跳过这一步)
[linux-devkit]:~/hello-world> qmake -project // The first command creates a project file: hello-world.pro.
[linux-devkit]:~/hello-world> qmake // The second generates a makefile based on the project file.
[linux-devkit]:~/hello-world> make // The third compiles and builds the project. . This is what you have just created
这是刚刚你创建的文件,或者生成的文件。
[linux-devkit]:~/hello-world> ls
hello-world hello-world.cpp hello-world.o hello-world.pro Makefile
. copy the hello-world binary over to your file system and run hello-world on your target.
将hello-world二进制文件拷入你的文件系统,并在目标机器上运行。

Building QT projects from the command line的更多相关文章

  1. Building Xcode iOS projects and creating *.ipa file from the command line

    For our development process of iOS applications, we are using Jenkins set up on the Mac Mini Server, ...

  2. qt opencv编译错误 /usr/local/lib/libopencv_imgcodecs.so.3.1:-1: error: error adding symbols: DSO missing from command line

    转载自:http://tbfungeek.github.io/2016/03/05/Opencv-%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87 ...

  3. How to build .apk file from command line(转)

    How to build .apk file from command line Created on Wednesday, 29 June 2011 14:32 If you don’t want ...

  4. How to deploy a Delphi OSX project from the command line

    Delphi has a well developed command line build process (via MSBuild) for Windows projects. After the ...

  5. ubuntu16.04安装virtualbox5.1失败 gcc:error:unrecognized command line option ‘-fstack-protector-strong’

    系统:ubuntu16.04.1 软件:Virtualbox-5.1 编译器:GCC 4.7.4 在如上环境下安装Vbx5.1提示我在终端执行/sbin/vboxconfig命令 照做 出现如下err ...

  6. cURL POST command line on WINDOWS RESTful service

    26down votefavorite 7 My problem: Running windows 7 and using the executable command line tool to cu ...

  7. 如何从Terminal Command Line编译并运行Scope

    Ubuntu SDK我们大部分的开发者是非常有效的.它甚至可以帮助我们进行在线调试.在这篇文章中,我们介绍了如何使用command line编译和执行我们scope. 1)创建一个主Scope 我们能 ...

  8. [笔记]The Linux command line

    Notes on The Linux Command Line (by W. E. Shotts Jr.) edited by Gopher 感觉博客园是不是搞了什么CSS在里头--在博客园显示效果挺 ...

  9. linux下安装QT5:error: unrecognized command line option ‘-fuse-ld=gold’

    安装qt时在执行./configure时报错:error: unrecognized command line option '-fuse-ld=gold' 这个错误是qt的一个bug. 在装有gol ...

随机推荐

  1. Python时间和日期学习

    #coding=utf-8 __author__ = 'Administrator' #日期和时间模块学习 """ Python程序能用很多方式处理日期和时间,转换日期格 ...

  2. 纯CSS实现多选组件

    mark: http://blog.meathill.com/tech/fe/create-multiple-select-component-with-pure-css.html Demo: 小宝3 ...

  3. Mysql 备份恢复之 Mysqldump 工具

    目前正在学习中,看到mysqldump工具导出的数据都是文本形式的,如果是blob或text大对象类型导出的是什么格式的?这个需要后续研究.下面只先总结下简单的. 一.备份1.备份Mysql一个数据库 ...

  4. Swift与Objective-C的对比

    WWDC 2014上苹果再次惊世骇俗的推出了新的编程语言Swift 雨燕, 这个消息会前没有半点风声的走漏.消息发布当时,会场一片惊呼,相信全球看直播的码农们当时也感觉脑袋被敲了一记闷棍吧.于是熬夜学 ...

  5. phpstorm运行在浏览器中执行php文件报502错误

    原因是之前mac自带的php5.5版本被我升级到了5.6 通过phpinfo()查看到目前php5.6的安装目录 重新制定一些interpreter的路径 /usr/local/php5/bin 就可 ...

  6. Linq语句基础

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  7. COUNT(*)与COUNT(列名)的区别(转)

    COUNT(*)与COUNT(列名)的区别       以前一直没有留意到COUNT(*)与COUNT(列名)的区别,昨天晚上无意中看到数据库系统工程师教程里面的一句话."如果null参与聚 ...

  8. 【搜索】BZOJ 3990: 【Sdoi 2015】排序

    3990: [SDOI2015]排序 Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 336  Solved: 164[Submit][Status][ ...

  9. 斯坦福数据挖掘Introduction

    感谢敖山.薛霄老师把我引进了统计学和现代服务业的大门.......至少是长见识了. 查相似项检索时发现的. 中间一部分资料来自厦门大学数据库实验室,感谢大牛们的传道授业,爱你们. 查资料时发现很多计算 ...

  10. 酷摄影:关于梦 - Miki takahashi

    这组摄影来自于日本东京摄影师 Miki takahashi 是一组双重曝光摄影,分开看也许很平常,但是结合在一起却非常有韵味. [gallery]