Sublime Text 3 Build Green C + + compilation Environment

Source: Internet
Author: User
Tags sublime directory sublime text


Because you want to create a plug-in with the green version of C + + compiler environment, and do not want to use vc6.0 (with a green version), after all, sublime interface is very comfortable, so we started to build sublime C + + compilation environment.

Required: MinGW Green-free version (in fact, I found a night also did not find, at least all need to set the environment variable path) Sublime text 3 free of installation version

First: Get the sublime, download the MinGW "No install version" copy to the sublime root directory into the Sublime-tools-build system-new build system, set up the configuration file of the compiler, and save the filename C + +. Sublime-build

{
	"path": "G:/sublime Text 3_x64 (Python and CPP)/mingw/bin",
	"cmd": ["G++.exe", "${file}", "O", "${file_path}/ ${file_base_name} "],
	" File_regex ":" ^ (.. [^:]*):([0-9]+]:? ([0-9]+)?:? (. *) $ ",
	" Working_dir ":" ${file_path} ",
	" selector ":" Source.c, source.c++ ",
	" encoding ":" UTF-8 ",	
	" Encoding ":" cp936 ","
	variants ":
	[
		{
			 " name ":" Run ",
			
			" cmd ": [" ${file_path}/${file_base_name} ". EXE "],
			" shell ": true,
            " cmd ": [" Start "," cmd ","/k "," ${file_path}/${file_base_name} &&echo. " & Pause && Exit "]
		}
}
Note 1: The first line of the path parameter in the file is different from other tutorials on the web, set the path parameter to the bin directory of the MinGW folder in the sublime directory, which means that the system environment variable is temporarily changed to the set value before the CMD compilation is performed. CMD execution is canceled after the modification, so there is no need to set the environment variable in the system 2:sublime the official document says ${packages} can be used to represent packages this directory but if I set up the use of ${packages in path Sublime seemingly did not recognize, so I did not use all the relative path, so every time I change the path of sublime must modify this path parameter here

For the fifth, how to really do it, after changing the sublime path still do not need to change path parameters, this question, I hope someone can answer me,

The least hassle-free set of environment variables in the system is described here. Of course, there is no need to configure the path parameter if there is a compilation environment that you do not need to configure the environment variables to use.

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.