Direct compilation of C + + with sublime Text3

Source: Internet
Author: User
Tags sublime text

First you have to download it.

This is the cpp,c++,gcc,g++ I left behind when I installed Codeblocks.

The second step is to create an environment variable

The three configurations are complete, OK.

Then go to sublime Text 3, locate the tool (tools), and in the compilation system, select the new compiled system.

Because it is a C + +, it will use the IO stream such as cin,cout, this time need to use CMD and then add the following code:

{    "Working_dir":"$file _path",    "cmd":"gcc-wall \ "$file _name\"-o \ "$file _base_name\"",    "File_regex":"^(.. [^:]*]:([0-9]+):? ([0-9]+)?:? (.*)$",    "selector":"source.c",    "variants":     [        {           "name":"Run",            "Shell_cmd":"gcc-wall \ "$file \"-o \ "$file _base_name\" && \ "${file_path}/${file_base_name}\""        }    ]}

The path is the default path, and the name is "Name.sublime-build" so that name is taken and saved.

Pressing the key combination "Ctrl" + "Shift" + "B" will pop up the compile Command Selection window, select "Name-run" compile, and the result will appear in the console below sublime.

Then just press "Ctrl" + "B" to

Direct compilation of C + + with sublime Text3

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: 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.