[英]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.