Skip to content

Instantly share code, notes, and snippets.

@sagebind
Last active May 29, 2022 00:23
Show Gist options
  • Save sagebind/9039773048a3900fa49a to your computer and use it in GitHub Desktop.
Save sagebind/9039773048a3900fa49a to your computer and use it in GitHub Desktop.
Sublime Text 3 C++ build system for mingw-w64
{
"cmd": ["g++", "-o", "${file_path}/${file_base_name}.exe", "-static-libgcc", "-static-libstdc++", "*.cpp"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.cpp, source.c++",
"path": "c:/Program Files/mingw-w64/mingw64/bin",
"shell": true,
"variants": [
{
"name": "Run",
"cmd": ["g++", "-o", "${file_path}/${file_base_name}.exe", "-static-libgcc", "-static-libstdc++", "*.cpp", "&", "${file_path}/${file_base_name}.exe"]
}
]
}
@ih4cku
Copy link

ih4cku commented May 11, 2015

Why use -static-libgcc and -static-libstdc++ options?

Also, I think *.cpp should be ${file}. Am I right?

@AltamiroAJ
Copy link

Would be possible to in any way add a PATH command so ST could compile using Ming installed in a USB Flash Drive?

@MME57
Copy link

MME57 commented Feb 24, 2019

It returns:
C:...\ld.exe: cannot open output file
C:\Users...\s.exe: Permission denied

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