【发布时间】:2021-04-15 14:44:38
【问题描述】:
我正在寻找一个 sublime text 3 构建系统,它可以在 C++14 中运行我的程序,使用终端从用户那里获取输入,并在终端中显示我的输出。在网上搜索后,我在网上找到了这样一个构建系统。构建系统如下:
{
/* Custom Build file for C++14, supports input from user.
* Default terminal emulator is gnome-terminal. You can change it to xterm or
* terminator by changing "gnome-terminal -x" in "cmd" in "variants" field to
* "xterm -e" or "terminator -x".
*/
"cmd": ["g++", "-std=c++14", "$file", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++, source.cxx, source.cpp",
"variants":
[
{
"name": "Run",
"cmd": ["bash", "-c", "g++ -std=c++14 '${file}' -o '${file_path}/${file_base_name}' && gnome-terminal -x bash -c '\"${file_path}/${file_base_name}\" ; read'"]
}
]
}
它完美地运行我的代码并完成我所看到的一切。但我在 sublime 控制台上收到一条消息:
# Option "-x" is deprecated and might be removed in a later version of gnome-terminal.
# Use "-- " to terminate the options and put the command line to execute after it.
[Finished in 1.3s]
这是什么意思?如何通过编辑我上面的 sublime 构建来解决这个问题?
【问题讨论】:
标签: c++ c++14 sublimetext3