-
-
Save mikhdm/10760478 to your computer and use it in GitHub Desktop.
{ | |
"cmd": ["vcvars32.bat", "&", "cl", "/EHsc", "${file}"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c, source.cpp, source.c++", | |
// By default cl is not in your PATH, so add it to your path (preferably) | |
// or uncomment "path" and check that it has correct value | |
//"path": "path:/to/folder/where/cl.exe/located", | |
// this also will set path for vcvars32.bat | |
"shell": true, // Without this sublime has hard times to parse "&" in out command line | |
"variants": | |
[ | |
{ | |
"name": "Run", | |
"cmd": ["vcvars32.bat", "&", "cl", "/EHsc", "${file}", "&", "${file_path}/${file_base_name}.exe"] | |
} | |
] | |
} |
Sorry, I didn't read the comment section, now I got it
Two things:
-
I can't get the linking to work. Having multiple .c files in the working directory results in the following error:
main.obj : error LNK2019: unresolved external symbol _foo referenced in function _main
-
Is it possible to remove the .obj files and automatically have sublime run the .exe file upon successful compilation?
ERROR: Cannot determine the location of the VS Common Tools folder.
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
HelloWorld.cpp
D:_Cache\2017\Jan\17\HelloWorld.cpp(1): fatal error C1034: iostream: no include path set
[Finished in 0.3s]
Mine:
{
"cmd": ["vcvars32.bat", "&", "cl", "/EHsc", "${file}"],
"file_regex": "^(..[^:]):([0-9]+):?([0-9]+)?:? (.)$",
"working_dir": "${file_path}",
"selector": "source.c, source.cpp, source.c++",
// By default cl is not in your PATH, so add it to your path (preferably)
// or uncomment "path" and check that it has correct value
//"path": "path:/to/folder/where/cl.exe/located",
"path": "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin",
// this also will set path for vcvars32.bat
"shell": true, // Without this sublime has hard times to parse "&" in out command line
"variants":
[
{
"name": "Run",
"cmd": ["vcvars32.bat", "&", "cl", "/EHsc", "${file}", "&", "${file_path}/${file_base_name}.exe"]
}
]
}
Any solution?
@vegetaz, exactly the same issue with you...
it says "'vcvars32.bat' is not recognized as an internal or external command,
operable program or batch file."
any ideas?