Install Ubuntu system under VMware and compile and run C language program

Install Ubuntu on the Vmware virtual machine and compile and run C language programs

Install VMware

First download Vmware16
and then install, enter the installer
Insert picture description here

Click next

Insert picture description here

Accept the license terms and click Next

Insert picture description here

Change the installation path (do not have Chinese), keep the default settings and click Next

Insert picture description here
Uncheck these two

Insert picture description here

Click next directly

Insert picture description here

Click Install
Insert picture description here
Enter the key and click Finish

Create a new Ubuntu virtual machine

Enter VMware and click to create a new virtual machine
Insert picture description here
Insert picture description here

Click Customize Next

Insert picture description here
Next step

Insert picture description here
Install the operating system later, click Next

Insert picture description here
Select the Linux version as the guest operating system, select Ubuntu Next step
Insert picture description here
Change the installation path of the Ubuntu system Next step

Insert picture description here
Keep the default for the next step

Insert picture description here

Keep the default for the next
step. All subsequent steps keep the default for the next step.

Insert picture description here
Click Customize Hardware,
Insert picture description here
enter CD/DVD, select ISO image file, find Ubuntu ISO file, and click OK to finish

Install Ununtu

Insert picture description here
Click to turn on this virtual machine

Insert picture description here
Choose Chinese as language and install Ubuntu

Insert picture description here
If you choose chinese on the keyboard, the next step is the default

Insert picture description here
Choose the smallest installation.
Next
, choose shanghai for the region and keep the default,
then set the user name and password.

Insert picture description here
Click Install now and wait for it to be installed and restart it. You can restart for the first time and press Enter once.
Insert picture description here

Compile and run C language programs

Enter the virtual machine and enter the password

Insert picture description here

Skip all, the next step

Enter the desktop at this time,
right-click to open in the terminal
Insert picture description here

Execute sudo apt install vimdownload vim tool
Execute sudo apt install gccdownload gcc compiler When
downloading, you need to enter a password, the password is not displayed in plain text
Execute vim hello.cto create the C language program hello.c
Insert picture description here

Then enter the vim editor mode,
Insert picture description here
press i to enter the insert mode, and then write a C language program, Insert picture description here
then press ESC to exit the insert mode

:
Then press Shift + : You can see a colon
Insert picture description here
at the bottom left. At this time, enter wq to save and exit

Insert picture description here
Next, use gcc to compile hello.c and press
gcc hello.c
Insert picture description here
Enter. You can see that there is one more a.out file, that is, the compiled file.
Insert picture description here
At this point, we execute the ./a.out
Insert picture description here
C language program successfully.

Guess you like

Origin blog.csdn.net/m0_47668487/article/details/115289154