[英]Trying to port windows build system to linux
此构建系统用于 c++ 中 3 列视图中 sublime 文本的竞争性编码
{
"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++","-std=c++17", "${file}", "-o", "${file_base_name}", "&&" , "./${file_base_name}<inputf.in>outputf.in"],
"shell":true,
"working_dir":"$file_path",
"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}"," && ", "./${file_base_name}<inputf.in>outputf.in"],
"shell":true,
"working_dir":"$file_path",
}
使用新的 v2 构建系统解决了无输入文件问题并且文件已编译但 outputf.in 文件中仍然没有 output
仅使用终端中的命令
g++ -std=c++17 file.cpp -o file &&./file<inputf.in>outputf.in
在 outputf.in 文件中产生 output
"cmd": ["g++ -std=c++17 ${file} -o ${file_base_name} && ./${file_base_name}<inputf.in>outputf.in"]
这个构建命令似乎对我有用,它对我来说工作得很好,我不知道为什么以及如何工作,但确实如此。
这个构建文件的灵感来自于博客文章
https://blog.codingblocks.com/2019/setting-up-ac-competitive-programming-environment/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.