Skip to content

Instantly share code, notes, and snippets.

@trietptm
Created February 14, 2013 01:51
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save trietptm/4950038 to your computer and use it in GitHub Desktop.
Save trietptm/4950038 to your computer and use it in GitHub Desktop.
Working C++.sublime-build on Windows
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd": ["${file_path}/${file_base_name}.exe"]
}
]
}
@idlephilosopher
Copy link

Thanks so much! This saved me a ton of time trying to figure out the details. :)

@gsantiago
Copy link

The scanf does not works.

@jpcofr
Copy link

jpcofr commented Mar 4, 2015

For the record, couldn't build at windows because I was opening sublime without administration privileges.

@jainrocks
Copy link

Hey what is file, file_path and file_base_name?

@jitsguy
Copy link

jitsguy commented Apr 20, 2015

Hi, Im new to this stuff, where do I paste that code in order for me to compile using cmd?

@lsandrade
Copy link

Thank you :)

@aanelzam93
Copy link

oke thank so much

@dprophecyguy
Copy link

How to use that code ?

@NaikSoftware
Copy link

@dprophecyguy Tools->Build System->New build system
But this config not working..

@shashank88
Copy link

Is there a way to default to g++ 11 ? like in linux we add "-std=c++11" flag ?
I want to use c++11 features like looping with auto etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment