Sublime Text 3 How to compile and run C + + programs

Source: Internet
Author: User
Tags sublime text

Pull

Went to a trip to the North school feel very special hi, the algorithm did not learn anything, the front end and the knowledge of the crawler will be a lot.


Then know that there is a call sublime Text 3 editor, easy to use not to know, just for it to look good, decided to use it later.

And then the trouble came out,

Can only edit can not compile what use Ah, console command is too troublesome, then I might as well dev-cpp go.

And spent a little time on the internet looking for a tutorial on configuring sublime

Because it took about half an hour to get the brains out.

Here's the thing.

First make sure the g++ compiler is installed in the system, and then configure the environment variables.

There are a lot of tutorials on the internet, and I don't need to waste my breath.

The successful effect of configuring environment variables is as follows:

Enter "g++" in cmd, carriage return, if the content shown in the picture appears, it proves that the configuration is complete.

Then you can open sublime and start the operation.

First find tools--build system, NEW build system ... on the (English) toolbar. Open it

Enter the following in the open file

1 {2"Encoding": "Utf-8",3"Working_dir": "$file _path",4"Shell_cmd": "g++-wall-std=c++11 \" $file _name\ "-o \" $file _base_name\ "",5"File_regex": "^ (... [^:]*]:([0-9]+):? ([0-9]+)?:? (.*)$",6"Selector": "Source.c++",7  8"Variants": 9     [Ten         {     One"Name": "Run", A"Shell_cmd": "g++-wall \" $file \ "-o \" $file _base_name\ "&& start cmd/c \" \ "${file_path}/${file_base_name}\" &am P Pause\ "" -         } -     ] the}

Then CTRL + S save, file name and so on to change the QWQ

And then your sublime can be compiled.

Compiled shortcut keys (not fast) are CTRL + Shift + B

Select the file you just configured in the window to compile the

-run that was compiled and run, no big deal.

Other than that

You can also debug the program (GDB) in the same way

Settings for shortcut adjustment self-Baidu look at it

< finish >

Sublime Text 3 How to compile and run C + + programs

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.