Editing Linux code with Visual Studio

Source: Internet
Author: User

It is estimated that many people are accustomed to the Visual Studio of the Lord, how do not adapt to the Linux set of editors, such as vim, source Insight, the visual eclipse effect is better, but generally to remotely share a Linux server mainly, Not so good condition one person a Linux machine.

I used a few months of insight, but also look at the code, anyway, personal feeling is awkward, now change with vs edit Code, feel much more cool.

The approximate method is as follows:

(1) Download the Linux code from SVN to the local directory.

(2) Open Visual Studio, select "File", "New", "Project from Existing Code" to create the project from the existing code.

(3) Select the directory of the Linux code and create a new project, such as the name Server_vs.

This time can be very convenient to see the code, but the lack of Linux system header files

(4) Download all files from the/usr/include directory on the Linux system to the local code directory, such as create a new subfolder include_linux.

Set the VS header file containing directories

(5) Right-click on the project name Server_vs, select "Properties", "C + +", "Additional Include Directories" To add a new item. \include_linux.

(6) Follow step 5, as long as the code in the go To definition, the definition of the header file can not be found, the need to include the directory added to ensure that any type will find the header file.

(7) Select the Text Editor for tools, options, VS, and select Auto-detect UTF-8 Encoding without signature to automatically detect UTF-8 encoding without signatures (D). Because Windows and Linux are not line-breaks, Windows uses \ r \ n To line up, and Linux uses \ n to wrap.

At this point you can use the powerful features of VS to edit code, such as automatically prompt what (to install VC assistant), very cool AH.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.