在过去的几天里,我一直在努力使用Sublime作为我编写基本C ++代码和学校作业的主要工具,而不是相当重的VS2017。
我已经尝试使用我在网络上找到的任何东西设置构建系统并根据我的需要进行编辑,但是我仍然没有成功构建。
这是我的构建系统的文件
{
"cmd": ["vcvars32.bat", "&&", "cl", "/EHsc", "/Za", "${file}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.cpp, source.c++, main.cpp, helloWorld.cpp",
"path": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\bin\\Hostx86\\x86",
"path" : "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build",
"shell": true,
"variants":
[
{
"name": "Run in output window", // for console programs that don't require input, otherwise it might run hidden
"cmd": ["vcvars32.bat", "&&", "cl", "/EHsc", "/Za", "${file}", "&&", "${file_path}/${file_base_name}.exe"]
},
{
"name": "Run in external window", // recommended
"cmd": ["vcvars32.bat", "&&", "cl", "/EHsc", "/Za", "${file}", "&&", "start", "/D", "${file_path}", "${file_base_name}.exe"]
}
]
}
当我尝试构建时,我得到以下内容:
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.6.1
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26128 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
helloWorld.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\crtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory
[Finished in 2.7s]
提前致谢