/************************************************************************
* 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. sublime text2 配置php调试环境

    步骤一: 首先确保你电脑安装了php,并把php设置到环境变量里了. 步骤二: 点击 sublime_text的“工具”->"编译系统"->"编译新系统&qu ...

  2. 配置spring的事务管理

    网上看到过很多关于spring事务管理的东西,但是原创的并不多,如果你的运气好能看到那些原创的文章恭喜你,因为我看到的不多,但一些原创的文 章里面枝叶太多,因为那些高手直接把自己的代码拷过来,所以说无 ...

  3. SVM整理

    SVM整理 Last modified: 2015.9.2 1.算法总结 支持向量机是Cortes和Vapnik于1995年首先提出的,它在解决小样本,非线性及高维模式识别中表现出许多特有的优势,并能 ...

  4. Objective-C程序结构及语法特点

    程序文件分为头文件(.h)和实现文件(.m): 使用#import关键字将所需的头文件导入程序,并且可以避免程序重复引用相同的头文件: @autoreleasepool { … } 自动释放池: 符号 ...

  5. 慎用ReentrantLock

    前言: 代码简洁与性能高效无法两全其美,本文章专注于并发程序的性能,如果您追求代码简洁,本文章可能不太适合,本文章属于Java Concurrency in Practice读书笔记. 在java5中 ...

  6. 第二好用的时间日期选择插件(jscal)

    这个是第二好用的了,支持鼠标滚动选择时间.功能很强大,文档:http://www.dynarch.com/jscal/ 效果图: <!DOCTYPE html PUBLIC            ...

  7. 1041: [HAOI2008]圆上的整点 - BZOJ

    Description 求一个给定的圆(x^2+y^2=r^2),在圆周上有多少个点的坐标是整数.Input rOutput 整点个数Sample Input4Sample Output4HINT n ...

  8. 【斜率DP】BZOJ 1911:特别行动队

    1911: [Apio2010]特别行动队 Time Limit: 4 Sec  Memory Limit: 64 MBSubmit: 3006  Solved: 1360[Submit][Statu ...

  9. 【数学/扩展欧几里得/Lucas定理】BZOJ 1951 :[Sdoi 2010]古代猪文

    Description “在那山的那边海的那边有一群小肥猪.他们活泼又聪明,他们调皮又灵敏.他们自由自在生活在那绿色的大草坪,他们善良勇敢相互都关心……” ——选自猪王国民歌 很久很久以前,在山的那边 ...

  10. bzoj 1228: [SDOI2009]E&D 阿达马矩阵

    1228: [SDOI2009]E&D Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 448  Solved: 240[Submit][Sta ...