/************************************************************************
* 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. 关于hadoop2.4.2版本学习时遇到的问题

    问题一:namenode启动失败 描述:在初始化后hadoop后,发现datanode启动失败,namenode则可以正常启动,如果把用户换成root权限,再次启动时,则namenode和datano ...

  2. C语言数据结构之栈:中缀表达式的计算

    *注:本人技术不咋的,就是拿代码出来和大家看看,代码漏洞百出,完全没有优化,主要看气质,是吧 学了数据结构——栈,当然少不了习题.习题中最难的也是最有意思的就是这个中缀表达式的计算了(可以算+-*/和 ...

  3. Java 多线程 简单实例 (消费者与生成者)的关系

    PS::线程这套东西在PHP里完全是不存在的概念,有待进一步的学习: PS::这个实例是根据书本上的知识进行扩展的,理解程度50%左右吧! 1.定义生产消费环境 package second; pub ...

  4. c#对字符串的各种操作

    1.字符串定义 2.在字符串后面追加字符串 3.获取字符串长度 4.截取字符串的一部分 5.字符串转为比特码 6.查指定位置是否为空字符 7.查字符串是否是标点符号 8.截头去尾(Trim) 9.替换 ...

  5. 微软职位内部推荐-Sr Development Lead-OSG-IPX

    微软近期Open的职位: Job Summary:Be part of Microsoft's strategy to deliver a great input experience across ...

  6. struts2的namespace

    struts2 的命名空间action里的name是个无关紧要的东西,namespace为‘/’表示所有 为‘/名字’,不管怎么访问只要名称空间些对了就不会错,/时你的请求地址可以直接写**Actio ...

  7. python学习笔记15(面向对象编程)

    虽然Python是解释性语言,但是它是面向对象的,能够进行对象编程. 一.如何定义一个类 在进行python面向对象编程之前,先来了解几个术语:类,类对象,实例对象,属性,函数和方法. 类是对现实世界 ...

  8. ServiceStack.Redis

    什么是Redis 首先,简述一下什么是Redis. Redis是一个开源.支持网络.基于内存.键值对存储数据库,使用ANSI C编写.从2013年5月开始,Redis的开发由Pivotal赞助.在这之 ...

  9. XCODE7新变化之-test

    Xcode 7新鲜出炉,一大早下载下来就安装上了,急急地体验一把.这几天公司给的任务是单元测试,那我们一起来用新版本做一次测试吧. 除了官方发布的下载链接地址,分享本人的xcode 7下载地址,大家不 ...

  10. 1065: [NOI2008]奥运物流 - BZOJ

    Sample Input4 1 0.52 3 1 310.0 10.0 10.0 10.0Sample Output30.00 推荐题解:http://blog.csdn.net/whjpji/art ...