2016-11-06 108 views

回答

4
  1. 您必须将C:\Windows\System32\bash.exe文件复制到C:\Windows\SysWOW64\目录。 因为WoW64 file system redirection(感谢Martin!)

  2. 然后你在用下面的代码崇高文本来创建一个新的构建系统的必需。 (Tools -> Build System -> New Build System...

    { 
        "cmd" : ["bash", "-c", "gcc ${file_name} -o ${file_base_name} && ./${file_base_name}"], 
        "shell": true, 
        "working_dir": "${file_path}", 
    }

    此代码将请编译的.C代码比运行它。输出将显示在Sublime的Build Results面板中。

  3. 当您想要使用此构建系统时,请在Tools -> Build System列表中选择它,然后点击Ctrl + B

可以costumize我把命令,更主要的是,你可以在64位Windows中使用32位的崇高文本时使用bash -c "CommandsYouWantToRun"

+0

是必要的第一步运行Linux的命令?我在[超级用户](http://superuser.com/questions/1140014/how-to-launch-bash-on-ubuntu-on-windows-from-third-party-application)上有类似的问题,这就是为什么我在问。 – idleberg

+0

是的,我想。我也使用了一个32位的Sublime Text,这对我来说很有用。 –

+2

作为附加说明:步骤#1是必需的,因为[WoW64文件系统重定向](https://msdn.microsoft.com/es-es/library/windows/desktop/aa384187(v = vs.85).aspx ) – Martin

相关问题