Difference between revisions of "IoTGateway/BSP/Linux/AM335x/Qt Application Development"

From ESS-WIKI
Jump to: navigation, search
(Setup Environment in command line mode)
Line 5: Line 5:
  
 
= Setup Environment in command line mode=
 
= Setup Environment in command line mode=
 +
If you want to build C, C++, Qt and other linux application, there is a magical script to use. It’s 
 +
environment-setup in the $(BSP_ROOT)/cross_compiler/linux-devkit directory. To build some linux application, you just need to excute this script as follow, and then everything will be ok.
 +
<pre>
 +
$ cd  $(BSP_ROOT)/cross_compiler/linux-devkit>
 +
$ source  environment-setup
 +
</pre>
 +
After this, you can buid Qt project. For example, we have a calculator qt demo to build as follow:
 +
<pre>
 +
$  cd  $(demo)/calculator
 +
$  ls
 +
button.cpp  button.h  calculator.cpp  calculator.h  calculator.pro  main.cpp
 +
$  qmake calculator.pro  ## Generating a makefile
 +
$  make  ## If no error, a binary will be generated after make.
 +
</pre>
 +
 
= Setup Environment in gui mode=
 
= Setup Environment in gui mode=

Revision as of 09:10, 28 September 2016

We have two ways to build a Qt project: the command line mode and the gui mode. We have a description as follow:

Setup Environment in command line mode

If you want to build C, C++, Qt and other linux application, there is a magical script to use. It’s environment-setup in the $(BSP_ROOT)/cross_compiler/linux-devkit directory. To build some linux application, you just need to excute this script as follow, and then everything will be ok.

$ cd  $(BSP_ROOT)/cross_compiler/linux-devkit> 
$ source  environment-setup

After this, you can buid Qt project. For example, we have a calculator qt demo to build as follow:

$  cd  $(demo)/calculator
$  ls 
button.cpp  button.h  calculator.cpp  calculator.h  calculator.pro  main.cpp
$  qmake calculator.pro   ## Generating a makefile
$  make  	## If no error, a binary will be generated after make.

Setup Environment in gui mode