Chapter 2 of the moblin unofficial tutorial series-Section 3-integrated development environment
Author: Xu Cheng
If you need to reprint it, please indicate the source.
An integrated development environment is a collection of multiple tools used in development, including at least a text editor, compiler, and debugger. C language programs are developed in Linux and moblin systems. Eclipse is the most convenient integrated development environment. In fact, eclipse does not have compilation and debugging functions. These functions are implemented by calling GCC and GDB. You can also use the Intel C ++ compiler, this idea represents the idea of open-source system design.
1. Installation
Eclipse is developed using the Java language. Therefore, you must install the Java Runtime Environment JRE. Run the following command to install JRE on fedora:
# Yum install JRE
For the moblin system, you must download the Java Runtime Environment installation package from the website of sun. For. Decompress the JRE installation package in the moblin system and run the installation file.
You can run the following command to install Eclipse:
# Yum install eclipse-CDT
The moblin system needs to download the Eclipse IDE for C/C ++ developers installation package from the official website at "www.eclipse.org ". Download and decompress the package to a directory with executable permissions.
After installation, you can start the integrated development environment by running the eclipse executable file. You need to set the eclipse working directory at the first startup to save the development project.
2. Create a project
A project is the management unit of eclipse. Each group of source code files or other resource files is called a project and stored in the same directory. Each project can generate only one executable file. Select the file | new | C Project command, and enter the relevant project name to create a new project.
3. Compile and run the project
The "Hello World" project is provided in the project creation dialog box. You can create the project first and then compile the project. Press Ctrl + B to compile the project. If the compilation is successful, click the run button or select the run menu command to run the program. The running result of the program is displayed in the console view at the bottom of the screen.
4. Debugging
For compiled projects, select Run | debug for debugging, as shown in Figure 2.5.
Figure 2.5 eclipse debugging page