Sublime Text 2和MinGW [英] Sublime Text 2 and MinGW

查看:139
本文介绍了Sublime Text 2和MinGW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天!



任何人都可以分享他们如何将MinGW编译器附加到Sublime的经验。



我在互联网上找到一个配置,但是当我运行编译程序弹出错误从../ MinGW / bin /。



丢失的文件配置:

  {
cmd:[mingw32-g ++。exe,-o,$ file_base_name $ file_name],
path:c:\\Program Files\\MinGW\\bin\\
}



谢谢!



UPD



我找到了我的问题的答案!我不得不在 cmd 中添加一个参数。它是 - static



所以,这是我的 MinGW.sublime-build ,工作正常:

  {
path:c:\\Program Files\\MinGW\\\\\\
cmd:[mingw32-g ++。exe,-static,-o,$ file_base_name,$ file]
}


解决方案

确保将bin文件包含在系统上的 p>

打开开始菜单并键入variable或environment variable(或google it)来找到如何做。你将得到一个有很多变量的窗口,找到Path(而不是PATH)变量并将路径添加到MinGW的bin文件夹。



和btw ,建议您应该按照文件更改file_base_name,并将file_base_name放在放置file_base的位置。



以下是我个人使用的命令:



cmd:[C:\\MinGW\\bin\\mingw32-g ++。exe, ,$ file,-o,$ file_base_name]


Good day!

Can anyone share their experience how to attach MinGW-compiler to Sublime?

I found a config in the internet, but when I run compiled program popping bugs with missing files from "../MinGW/bin/".

Config:

{
   "cmd": ["mingw32-g++.exe", "-o", "$file_base_name", "$file_name"],
   "path": "c:\\Program Files\\MinGW\\bin\\"
}

Thanks!

UPD

I found answer for my question! I had to add one parameter in cmd. It's "-static".

So, it's my MinGW.sublime-build, which works fine:

{
    "path": "c:\\Program Files\\MinGW\\bin\\",
    "cmd": ["mingw32-g++.exe", "-static", "-o", "$file_base_name", "$file"]
}

解决方案

Make sure to include the bin file in the "Path" variable on your system.

Open the start menu and type "variable" or "environment variable" (or google it) to find how to do it. You'll get in a Window with a lot of variables, find the Path (and not PATH) variable and add the path to the bin folder of MinGW.

And btw, as suggested, you should change file_base_name by file, and put file_base_name where you put file_base.

Here's the command I personally use:

"cmd": ["C:\\MinGW\\bin\\mingw32-g++.exe", "-Wall", "-time", "$file", "-o", "$file_base_name"]

这篇关于Sublime Text 2和MinGW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆