/************************************************************************
* 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. Spark Streaming揭秘 Day12 数据安全容错(Executor篇)

    Spark Streaming揭秘 Day12 数据安全容错(Executor篇) 今天,让我们研究下SparkStreaming在Executor端的数据安全及容错机制. 在SparkStreami ...

  2. 1046 Shortest Distance (20)

    #include<stdio.h> int main() { int n,m,a,b,tem,pre,p; int i,j; ]; while(scanf("%d",& ...

  3. C#网络编程(1)

    1.Purpose 1.什么是网络编程 2.TCP/IP协议 3.什么是套接字 4.多线程深入理解 二.Basic Concept 1.网络编程:主要实现进程(线程)相互之间的通信和基本的网络应用原理 ...

  4. iOS 深复制&浅复制

        1.无论是深复制还是浅复制,被复制的对象类型是不变的.此对象类型具有什么功能就具有什么功能,不会因为自行修改了返回对象的指针类型而改变.   比如: 这里的str和str1的值和指针地址完全一 ...

  5. 微软职位内部推荐-Pricipal Dev Manager for Application Ecosystem & Service

    微软近期Open的职位: Location: China, BeijingDivision: Operations System Group Engineering Group OverviewOSG ...

  6. 盒模型------CSS

    盒子的内心世界 1.模型 通过CSS的眼睛 在CSS看来,HTML的所有元素都被看成了盒子:段落,标题,块引用,列表,列表项等.甚至内联元素. 盒子的组成 内容区(content):包含内容(文本或图 ...

  7. NodeJS用递归实现异步操作的链式调用,完成一个简易的命令行输入输出REPL交互接口

    REPL —— Read-Eval-Print-Loop. 00.一门好的编程语言的必要条件 REPL并不是什么高大上的东西,简单的说就是一个从命令行程序,读取终端输入,处理,打印结果,如此循环.这是 ...

  8. c#无标题窗体点击任务栏图标正常最小化或还原

    FormBorderStyle等于System.Windows.Forms.FormBorderStyle.None的窗体,点击任务栏图标的时候,是不能象标准窗体那样最小化或还原的. protecte ...

  9. 团体程序设计天梯赛-练习集L1-016. 查验身份证

    L1-016. 查验身份证 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 一个合法的身份证号码由17位地区.日期编号和顺序编号 ...

  10. PHP 7 值得期待的新特性(上)

    这是我们期待已久的 PHP 7 系列文章的第一篇. 或许你已经知道了,我在 PHP 5.0.0 时间轴 提的 RFC (Request For Comments)通过了, PHP 7 成为 PHP 下 ...