Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use VSCode in Ubuntu20.04

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use VSCode in Ubuntu20.04, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

1. Prepare for

a. Software installation

You can install it through the software store or download it.

Download and install the official website address: https://code.visualstudio.com/.

You can download the installation software in both deb and rpm formats.

b. Catalog plan

In the process of writing a program, you need to decide in advance where to put the program, which requires a directory plan. Any software project also needs to be cataloged so that the programs you write can be stored in a place that is easy to find and use.

Create a VSCODE directory here to store the program code. For further classification, create a subdirectory CSP under the VSCODE directory in which the code can be written. As shown in the following figure:

two。 Run VS Code and install the Candlestick + plug-in

a. Run VS Code

Run VS Code to display the following interface:

b. Install the plug-in Candlestick +

3. Write a program

a. Open folder (directory)

Click the menu File-Open Folder … To display the following interface, and select the CSP directory in the interface:

Click the "OK" button to return to the VS Code interface, and click CSP:

b. Create C _ file and write programs

In the image above, click the "New File" button to the right of CSP and enter the file name "Hello.c" to create a blank file. After entering the program in the file and saving it, as shown in the following figure:

4. Run the program

Click the menu Run-Run Without Debugging (shortcut key Ctrl F5) to run the program.

Click the menu Run-Start Debugging (shortcut key F5) to run the program in debug mode (you can run it in a single step or directly to a breakpoint).

At this point, you need to choose the running environment, select "C++ (GDB/LLDB)" here, and then continue to select "gcc-generate debugging activity file", which will automatically generate a "launch.json" file (which will be generated for the first time).

Close the file "launch.json" and run it again. The result is as follows:

5. Debug program

a. Set breakpoint

Click the blank space before the line number of the source program to set the breakpoint.

Place the cursor over the line where you want to set the breakpoint. Press F9 to set / cancel the breakpoint for that line.

b. Debugging (Debug) run

Use various commands in the menu Run to debug the program.

6. Other

VS Code can only be used on hand, and can be barely used in exams and competitions.

It is worth exploring whether it is appropriate in engineering projects, perhaps not many actual engineering projects will use the software.

Thank you for reading this article carefully. I hope the article "how to use VSCode in Ubuntu20.04" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report