57
RSB-4221 User Manual
Chapter 4
LinuxBSP
4.9
development guide and reference
4.9.1
Development of C/C++ Programs
This section will guide you how to write a sample application “Hello World”. You can
refer to the following steps:
1.
Open "Terminal" on Ubuntu 12.04 LTS and Change to “root”:
Type user password.
2.
Create the develop environment using flowing command:
3.
Edit the helloworld.c with the following source code:
#include <stdio.h>
void main()
{
printf("Hello World!\n");
}
Save the file and exit.
4.
Compile helloworld.c using flowing command:
Then you can see “helloworld” in current directory.
5.
Run the executable file helloworld on the RSB-4221.
Insert the Linux system SD card into your development computer.
Note.
/media/rootfs is the mounted point of your Linux system SD card
Remove this SD card and insert it to RSB-4221, then open serial console.
On RSB-4221 platform, type #root (Login)
On RSB-4221 platform, type #cd /tool
On RSB-4221 platform, type #./helloworld
Now you should be able to see “Hello World!” shown on RSB-4221.
4.9.2
Development of GUI Programs with QT Library
With the development kit, you can develop a qt-based GUI program. Follow these
steps, you can quickly convert your QT Project to a GUI application for RSB-4221:
1.
On your host PC, set up QT Build Environment
$ sudo su
#source /usr/local/cross_compiler/linux-devkit/environment-
setup
# cd /root//4221LBVxxxx_yyyy_mm_dd/source
# mkdirhelloworld
# cd helloworld
# gedithellowrold.c
# $CC -o helloworld helloworld.c
# cp helloworld /media/rootfs/tool
#source /usr/local/cross_compiler/linux-devkit/environment-
setup
Содержание RSB-4221
Страница 6: ...RSB 4221 User Manual vi...
Страница 10: ...RSB 4221 User Manual x...
Страница 14: ...RSB 4221 User Manual 4...
Страница 33: ...23 RSB 4221 User Manual Chapter 2 H W Installation 2 3 2 Board Dimension...
Страница 35: ...Chapter 3 3 Software Functionality This chapter details the software programs on the RSB 4221 plat form...
Страница 48: ...RSB 4221 User Manual 38...
Страница 49: ...Chapter 4 4 LinuxBSP This chapter introduces how to build an Android system and develop based our Linux system...