我的解决办法:新建一个build systems
//my_cpp
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,
"variants":
[
{
"name": "Run",
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}", "&", "${file_path}/${file_base_name}.exe"]
}
]
}
但是只能通过点手动run,快捷键ctrl shift B不起作用
这样就解决了:
//my_cpp
{
//"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}", "&", "${file_path}/${file_base_name}.exe"]
}
这是我试出来更好的
//C++_My
{
//"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,
"cmd": [ "g++", "${file}", "-o", "${file_path}/${file_base_name}", "&","start", "${file_path}/${file_base_name}.exe"]
}
你确定编译了么……没见调用gcc,g++或者make……
"/.exe"不是st的通用变量,在linux下可以这么用,windows下不行
如果生成的exe文件名和当前的源文件同名则使用'$file_base_name.exe'
或者使用st建project的话可以是$project_name.exe等
我自己的st build是这么配置的:(make编译,可执行文件名和原文件相同)
{
"cmd": "mingw32-make",
"file_regex": "^([^:]+):([0-9]+):",
"shell": true,
"working_dir": "$file_path",
"variants": [
{
"cmd" : ["start", "cmd", "$file_base_name.exe"],
"name": "run",
"shell": true,
"working_dir": "$file_path"
}
]
}
Photoshop|
Dreamweaver|
SVG|
WebGL|
Visual Studio|
PowerDesigner|
Eclipse|
Git|
Apache Ant|
Atom|
Composer|
CodeSmith|
Flex|
Gradle|
Maven|
Sublime Text3|
SVN|
Tableau|
Vim|
Chrome开发者工具|
OpenGL|
Unity|
Direct3D|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....