尝试将Windows构建系统移植到Linux

问题描述

此构建系统用于在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

在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/

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...