如何在 Sublime Text 3 中運行 C 11?
我發現了這個并且它有效,但我希望它能夠在每次運行時打開 cmd。
(1)
{
"shell_cmd": "g -std=c 11 \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9] ):?([0-9] )?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c ",
"variants":
[
{
"name": "Run",
"shell_cmd": "g -std=c 11 \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
}
]
}
喜歡這個:(2)
{
"cmd":
[
"g ", "-Wall", "-ansi", "-pedantic-errors", "$file_name", "-o",
"${file_base_name}.exe", "&&", "start",
"cmd", "/k" , "$file_base_name"
],
"selector": "source.cpp",
"working_dir": "${file_path}",
"shell": true
}
(1) 的問題是它與 Sublime Text 3 中的控制臺一起運行,不幸的是,我不希望這樣。(2) 的問題是它運行良好并且每次都打開 CMD,這是我需要的,但它在 C 98 上。當我需要 C 11 時。
那么,有沒有辦法修改這些構建系統中的任何一個,以便我可以運行 C 11 并使其每次運行都打開 CMD(而不是在控制臺上運行它)?謝謝。
uj5u.com熱心網友回復:
我能夠通過一些修補來解決這個問題。
{
"shell_cmd": "g -std=c 11 \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9] ):?([0-9] )?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c ",
"variants":
[
{
"name": "Run",
"shell_cmd": "g -std=c 11 \"${file}\" -o \"${file_path}/${file_base_name}\" && start cmd /k \"${file_path}/${file_base_name}\""
}
]
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/512563.html
