Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/163.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
升华:构建系统变量不工作 我尝试过使用C++的默认构建系统。变量$file似乎出错了。以下是构建脚本的外观: { "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": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"] } ] }_C++_Mingw_Sublimetext2 - Fatal编程技术网

升华:构建系统变量不工作 我尝试过使用C++的默认构建系统。变量$file似乎出错了。以下是构建脚本的外观: { "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": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"] } ] }

升华:构建系统变量不工作 我尝试过使用C++的默认构建系统。变量$file似乎出错了。以下是构建脚本的外观: { "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": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"] } ] },c++,mingw,sublimetext2,C++,Mingw,Sublimetext2,而且,每当我尝试编译时,都会出现以下错误: [Error 2] The system cannot find the file specified [cmd: [u'g++', u'C:\\Users\\Ankit Mongia\\workspace\\HelloWorld\\HelloWorld.cpp', u'-o', u'C:\\Users\\Ankit Mongia\\workspace\\HelloWorld${file_base_name}']] [dir: C:\Users\

而且,每当我尝试编译时,都会出现以下错误:

 [Error 2] The system cannot find the file specified
[cmd:  [u'g++', u'C:\\Users\\Ankit Mongia\\workspace\\HelloWorld\\HelloWorld.cpp', u'-o', u'C:\\Users\\Ankit Mongia\\workspace\\HelloWorld${file_base_name}']]
[dir:  C:\Users\Ankit Mongia\workspace\HelloWorld]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\Ankit Mongia\AppData\Local\Programs\Python\Python35-32\Scripts\;C:\Users\Ankit Mongia\AppData\Local\Programs\Python\Python35-32\; E:\Development\MinGW\bin\]
[Finished]
我不明白为什么脚本会弄乱windows的路径格式?它在“cmd”中有两个反斜杠,在“path”中有一个反斜杠。我不明白“cmd”中的“u”字。
我不确定“变体”有多重要,我的windows机器上没有bash可执行文件。我无法理解编译错误。

您保存了文件吗?您是否尝试预先添加
“echo”
以查看您的命令是什么样子的?可以使用Ctrl-Shift-B选择变体,但是由于您没有bash,因此不需要使用它。您保存了文件吗?您是否尝试预先添加
“echo”
以查看您的命令是什么样子的?可以使用Ctrl-Shift-B选择变体,但由于没有bash,因此不需要使用它。