简体   繁体   English

尝试将 windows 构建系统移植到 linux

[英]Trying to port windows build system to linux

This build system is for competitive coding in c++ on sublime text in 3 column view此构建系统用于 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"
}

edits made for the port为端口所做的编辑

{
"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"
}

errors错误

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]


edits made for the port v2为端口 v2 所做的编辑


{ 
"cmd": ["g++ -std=c++17 ${file} -o ${file_base_name}"," && ", "./${file_base_name}<inputf.in>outputf.in"],
"shell":true,
"working_dir":"$file_path",
}

using the new v2 build system the no input file issue is resolved and the file is complied but still there is no output in the outputf.in file使用新的 v2 构建系统解决了无输入文件问题并且文件已编译但 outputf.in 文件中仍然没有 output

using just the command in terminal仅使用终端中的命令

g++ -std=c++17 file.cpp -o file &&./file<inputf.in>outputf.in

produces output in the outputf.in file在 outputf.in 文件中产生 output

"cmd": ["g++ -std=c++17 ${file} -o ${file_base_name} && ./${file_base_name}<inputf.in>outputf.in"]

this build command seems to do the trick for me it works perfectly fine for me, i dont know why and how this works but it does.这个构建命令似乎对我有用,它对我来说工作得很好,我不知道为什么以及如何工作,但确实如此。

this build file was inspired form a blog post at这个构建文件的灵感来自于博客文章

https://blog.codingblocks.com/2019/setting-up-ac-competitive-programming-environment/ https://blog.codingblocks.com/2019/setting-up-ac-competitive-programming-environment/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM