Sublime Text Add A/C + + Environment

Source: Internet
Author: User
Tags sublime text

Lightweight and convenient sublime text 3 code editing is very powerful, but as a code-editing software, if we let it run our C or C + + code, and become a lightweight compiler that's better! Let's talk about it today. How to Sublime C/C + + in order to enable it to run the code (with Sublime:sublime Text 3)) [http://www.sublimetext.com/]

First of all, we have a compiler, if you already have codeblocks or dev-c++, then look directly at the next step. If not, we need to download a compiler first, here is (MinGW: MinGW) [http://www.mingw.org/]

Installing MinGW

Configure environment variables. Locate the Bin folder under your MinGW installation path, configure environment variables

Configure sublime, open sublime, click Tools→build system→new Build System

{    "cmd": ["g++", ,"-Wall","${file}", "-o", "${file_path}/${file_base_name}"],    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",    "working_dir": "${file_path}",    "selector": "source.c, source.c++",    "encoding":"cp936",    "variants":    [    {    "name": "Run",    "cmd": ["cmd", "/c", "g++", "-Wall","${file}", "-o", "${file_path}/${file_base_name}", "&&", "cmd", "/c", "${file_path}/${file_base_name}"]    },    {    "name": "RunInCommand",    "cmd": ["cmd", "/c", "g++", "-Wall","${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & echo.&pause"]    }    ]}
To configure a compilation shortcut key

[    {"keys": ["ctrl+F11"], "command": "build", "args": {"variant": "RunInCommand"}}]
Sublime No Debug

Sublime Text Add A/C + + Environment

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.