Building QT projects from the command line

/************************************************************************
 *            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

二、基本操作流程:
    1. After Installing your host Ubuntu and then the SDK on your host machine: [How to install Ubuntu and your SDK]
        在你电脑上安装Ubuntu及SDK。
    2. Create a new directory on your Ubuntu 10.04 host.
        在Ubuntu中创建一个目录,叫:hello-world。
        [email protected]-desktop:~$mkdir hello-world
    3. Change to that directory
        进入刚刚创建的目录 。
        [email protected]-desktop:~$cd hello-world
    4. Source the environment setup to get access to qmake and the gcc compiler
        导入环境变量,这样你才能够使用qmake和gcc编译器。
        [email protected]-desktop:~/hello-world$ source /home/user/ti-sdk-am335x-evm-05.03.00.00/linux-devkit/environment-setup
    5. 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();
        }
    6. Execute the following commands: (If you already have a project file skip step 1)
        执行以下命令:(如果你已经有一个工程项目文件,请跳过这一步)
        [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.

    7. This is what you have just created
        这是刚刚你创建的文件,或者生成的文件。
        [linux-devkit]:~/hello-world> ls
        hello-world  hello-world.cpp  hello-world.o  hello-world.pro  Makefile
    8. copy the hello-world binary over to your file system and run hello-world on your target.
        将hello-world二进制文件拷入你的文件系统,并在目标机器上运行。
时间: 2024-10-15 05:30:16

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

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, acting as a Continuous Integration (CI) server. It’s fairly easy to configure Jenkins for Xcode projects using Xcode Plugin - however, from time to t

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 to install a number of programs for building your Android project, this article is for you. You will need only JDK, the Android SDK platform tools and

Spring Boot 项目构建 之 使用 Gradle 构建 Java 项目(Building Java Projects with Gradle)

Table of contents What you'll build What you'll need How to complete this guide Set up the project Install Gradle Find out what Gradle can do Build Java code Declare dependencies Build your project with Gradle Wrapper Summary Tags gradle Concepts and

Building C Projects

C is a compiled language, and as such, C programs need to be converted to executables in order to use them.  Typically, programmers do this with some sort of build system, rather than running the necessary commands manually, because the compilation p

【转载】Data Science at the Command Line

Data Science at the Command Line Data Science at the Command Line is a new book written by Jeroen Janssens. This website contains information about the upcoming workshop in London, the webcast from August 20th, instructions on how to install the Data

Adeneo Embedded: Building Qt 5.1 for Freescale i.MX6Introduction on LTIB

Adeneo Embedded: Building Qt 5.1 for Freescale i.MX6Introduction Currently there is not an easy procedure to build Qt 5.1 with hardware acceleration support for Freescale i.MX6 platform. This document describes the steps necessary to download all the

Appendix D. Gradle Command Line

http://www.gradle.org/docs/current/userguide/gradle_command_line.html Appendix D. Gradle Command Line The gradle command has the following usage: gradle [option...] [task...] The command-line options available for the gradle command are listed below:

Learn Enough Command Line

目录 1 Basics 1.1 Running a terminal 1.2 Our first command 1.3 Man pages 1.4 Editing the line 1.5 Cleaning up 1.6 Summary 2 Manipulating files 2.1 Redirecting and appending 2.2 Listing 2.3 Renaming, copying, deleting 2.4 Summary 3 Inspecting files 3.1

linux下配置QT5.12 ERROR: Unknown command line option &#39;-no-xcursor&#39;.!

xcursor是个什么东西.为什么会报错,怎么处理!在qt的autoconfigure.sh中添加下三条命令都不行.提示不认识-no-xcursor或者不认识nomake命令. -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -no-fontconfig \-nomake examples -nomake tools -nomake tests -no-iconv \ linux下配置QT5.12 ERR