Using Sublime Text 3 to debug/run A/C + + program under Windows

Source: Internet
Author: User
Tags sublime text

System: Windows 8.1 64bit

Software: Sublime Text 3 Build3065 x86

Compiling software: MinGW

1. Download Sublime Text 3

2. I'm using the flow of a voiceless change + -bit version, - The position seems to be unstable.

3. : http://haojian138.blog.163.com/blog/static/212643110201393010438357/

4. Download: MinGW . Address:http://sourceforge.net/projects/orwelldevcpp/files/Compilers/MinGW/MinGW%204.8.1.7z/download

5. Personal Network disk: Http://pan.baidu.com/s/1qWlvAgs

Http://pan.baidu.com/s/1eQIPZaE

6.       unzip MinGW

7.     --> advanced --> environment variable.

  1) in system environment variables path c:\mingw\bin (if there are any other variables, remember to add the English semicolon ; )

    2) new library_path variable, add c:\ Mingw\lib

   3) new c_includede_path variable, value set to C:\MinGW\include

  ps mingw installation path set

8.     test mingw Whether the installation was successful. win+r cmd command line, in CMD window execution g++-v

    1. 9.        Run as Administrator sublime text 3, Enter menu Tool - à compilation system - à New compilation system

enter the following and save the file as Cpp.sublime-build ( be careful not to modify the file name and capitalization ) .

{

"cmd": ["g++", "${file}", "-O", "${file_path}/${file_base_name}"],

"File_regex": "^ (... [^:]*]:([0-9]+):? ([0-9]+)?:? (.*)$",

"Working_dir": "${file_path}",

"Encoding": "cp936",

"Selector": "Source.c",

"Variants":

[

{

"Name": "Run",

"cmd": ["cmd", "/C", "Start", "cmd", "/C", "${file_path}/${file_base_name}.exe & Pause"]

}

]

}

  1. . test. Before compiling in the tool -Compiling the system SelectCPP. himself inSublimetextWrite aC + +programs thatctrl+bfor compiling;ctrl+shift+bfor the post-compilationCMDrun in. For example, both Chinese and English are displayed normally.


Using Sublime Text 3 to debug/run A/C + + program under Windows

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.