当前位置: 首页 > 知识库问答 >
问题:

Sublime text 3用C++构建系统,从终端输入

平庆
2023-03-14

我正在寻找一个Sublime的文本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 console上收到一条消息,上面写着:

# 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的构建来修复它呢?

共有1个答案

锺离声
2023-03-14

警告信息是完全不言自明的。在“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'"]

&之后,不使用gnome-terminal-x bash-c...,只需将gnome-terminal--bash-c...,您就全部设置好了。

 类似资料:
  • 问题内容: 我将很快开始一个新的C++项目(它可能也包含一些C组件),并且我正在寻找一个现代的,具有工业实力的(即非beta)构建系统。该软件将由3-5个开发人员在3-5年内创建,并将在Linux上运行(稍后 可能 会支持Mac OS X和Windows )。我正在寻找一种比例如具有更好的可理解性,易用性和可维护性,但仍足以处理复杂项目的功能。首选开源软件。 我开始寻找到,,和到目前为止,喜欢的功

  • 13. 构建系统 强烈建议您选择一个支持依赖管理的构建系统,而且这个构建系统能够使用发布到“Maven Central”库中的组件。我们建议您选择Maven或Gradle。Spring Boot有可能与其他构建系统(例如Ant)一起工作,但是其他构建系统不会得到特别好的支持。

  • 强烈建议您选择支持依赖关系管理且可以使用发布到“Maven Central”存储库的artifacts的构建系统。 我们建议您选择Maven或Gradle。 可以让Spring Boot与其他构建系统(例如Ant)一起工作,但它们并没有得到特别好的支持。

  • Electron 使用 gyp 来生成项目 ,使用 ninja 来构建项目. 项目配置可以在 .gyp 和 .gypi 文件中找到. Gyp 文件 下面的 gyp 文件包含了构建 Electron 的主要规则 : atom.gyp 定义了 Electron 它自己是怎样被构建的. common.gypi 调整 node 的构建配置,来让它结合 Chromium 一起构建. vendor/brigh

  • Electron使用gyp进行项目生成,使用ninja进行构建。项目配置可以在 .gyp和 .gypi文件中找到。 Gyp文件 下面的 gyp文件包含了构建Electron的主要规则: electron.gyp定义了Electron本身是如何构建的。 common.gypi调整Node的构建配置,使其与Chromium一起构建。 brightray/brightray.gyp定义brightray

  • Electron 使用 GN 生成项目,并用 Ninja 完成构建。 项目配置位于 .gn 和 .gni 文件中。 Build System Overview Electron uses GN for project generation and ninja for building. Project configurations can be found in the .gn and .gni