Building QT projects from the command line

Source: Internet
Author: User

/************************************************************************ * Building QT projects from the COM Mand Line * Description: * Most of the time, the project is created and compiled through Qtcreator, but sometimes it is possible to encounter some compilation problems, when the command lines create a project, compile the project can be used as a test, verification of a means. * 2016-3-2 Shenzhen Nanshan Ping Shan village Zengjianfeng ************************************************************ ***********/One, reference document: Building QT projects fromThe command line http://processors.wiki.ti.com/index.php/building_qt_projectssecond, the basic operating procedures:1. After installing your host Ubuntu and then the SDK on your host machines: [How to install Ubuntu and your SDK] on your computer    Install Ubuntu and SDK. 2. Create ANewdirectory on your Ubuntu10.04host. Create a directory in Ubuntu, called: Hello-World . [Email protected]-desktop:~ $mkdir hello- World3.        Change to that directory enters the catalog that you just created. [Email protected]-desktop:~ $CD hello- World4. Source the environment Setup toGetaccess to Qmake and the GCC compiler import environment variables so that you can use the Qmake and GCC compilers. [Email protected]-desktop:~/hello-world$ source/home/user/ti-sdk-am335x-evm-05.03.00.00/linux-devkit/environment-Setup5. Create ANewFile:hello-world.cpp and copyinchThe following source code to hello-world.cpp Create Hello-world.cpp file, and copy the following source code into the file. #include<QApplication>#include<QLabel>intMainintargcChar**argv)                        {qapplication app (argc, argv); Qlabel Label ("Hello world!");                        Label.show (); returnapp.exec (); }    6. Execute the following commands: (If you already has a project file skip step1execute the following command: (skip this step if you already have a project file) [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 isWhat do you have just created this is the file that you created, or the file that was just generated. [Linux-devkit]:~/hello-world>ls Hello-world hello-world.cpp HELLO-WORLD.O hello-World.pro Makefile8. Copy the Hello-world binary over to your file system and run hello-World on your target. Will HelloThe-world binaries are copied into your file system and run on the target machine.

Building QT projects from the command line

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.