Building a Linux environment and developing under Linux

There are many Linux distributions, such as Ubuntu, Fedora, centos web, ArchLinux, and Red Flag Linux.  

Red Hat Linux, Loki, Mint. This article mainly explains embedded software development in Ubuntu.

1. Linux environment setup

1. Download VMware 

2. Install Ubuntu (it must be set up reasonably according to your own computer configuration)

Since I am using the installation-free version, you can refer to these two blog posts.

 Download and install the latest VMware16pro virtual machine_People truly become strong not when they guard their self-esteem, but when they put aside their self-esteem.
[Linux] Ubuntu 20.04 installation tutorial (detailed graphic and text explanation)


 


2. Develop under Linux

1. Use vi for code editing

        1.1 After opening the virtual machine, bring up the command terminal window through the keyboard: CTRL + Alt + T 

        1.2.vi+space+demo.c will create a c file named demo, as shown below:

        1.3 Enter the command line mode by default. To edit code, you need to enter the input mode. You can enter by pressing i on the keyboard. As shown in the picture: there is INSERT in the lower left corner, which means entering the input mode, and you can enter the code.

          1.4 After entering the code, press esc on the keyboard to return to the command line mode (INSERT in the lower left corner disappears)

          1.5 Launch vi to save the code: Press (colon) wq (w save q to exit) in command line mode. This is the initial command terminal window. You can see a demo.c file on the desktop, or enter ls View all files under the current folder.

2. Use gcc compilation tool to compile

           2.1 gcc demo.c -0 demo demo.c is the c file just created. o represents output. It is compiled to produce an executable file called demo.

           2.2 ./+demo (file name generated by compilation)

I just wrote it, so the content is not very good. Please bear with me. If there are any mistakes in the content, please point it out so that I can correct it. Thank you all!

Supongo que te gusta

Origin blog.csdn.net/qq_44848795/article/details/121346260
Recomendado
Clasificación