问题描述
此构建系统用于在3列视图中的崇高文本上使用c ++进行竞争性编码
{
"cmd": ["g++.exe","-std=c++17","${file}","-o","${file_base_name}.exe","&&","./${file_base_name}.exe<inputf.in>outputf.in"],"shell":true,"working_dir":"$file_path","selector":"source.cpp"
}
为该端口所做的修改
{
"cmd": ["g++","${file_base_name}","./${file_base_name}<inputf.in>outputf.in"],"selector":"source.cpp"
}
g++: Fatal error: no input files
compilation terminated.
[Finished in 0.0s with exit code 1]
[cmd: ['g++','-std=c++17','/home/xxx/Documents/CP/file.cpp','-o','file','&&','./file<inputf.in>outputf.in']]
[dir: /home/xxx/Documents/CP]
[path: /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl]
为端口v2所做的编辑
{
"cmd": ["g++ -std=c++17 ${file} -o ${file_base_name}"," && ",}
使用新的v2生成系统,没有输入文件的问题已解决,并且已编译文件,但outputf.in文件中仍然没有输出
仅使用终端中的命令
g++ -std=c++17 file.cpp -o file && ./file<inputf.in>outputf.in
解决方法
"cmd": ["g++ -std=c++17 ${file} -o ${file_base_name} && ./${file_base_name}<inputf.in>outputf.in"]
这个构建命令似乎对我有用,它对我来说非常好,我不知道为什么和如何工作,但确实如此。
此构建文件的灵感来自博客帖子,网址为
https://blog.codingblocks.com/2019/setting-up-a-c-competitive-programming-environment/