Mac OS Sierra 配置sublime text3 C语言开发环境

#安装

1.1 下载

sublime text3的下载自行官网www.sublimetext.com/

1.2序号:

----- BEGIN LICENSE -----

TwitterInc

200 User License

EA7E-890007

1D77F72E 390CDD93 4DCBA022 FAF60790

61AA12C0 A37081C5 D0316412 4584D136

94D7F7D4 95BC8C1C 527DA828 560BB037

D1EDDD8C AE7B379F 50C9D69D B35179EF

2FE898C4 8E4277A8 555CE714 E1FB0E43

D5D52613 C3D12E98 BC49967F 7652EED2

9D2D2E61 67610860 6D338B72 5CF95C69

E36B85CC 84991F19 7575D828 470A92AB

------ END LICENSE ------

----- BEGIN LICENSE -----

Bug7sec Team (www.bug7sec.org)

50 User License

EA7E-1068832

86C49532 8F829C68 2ED18D56 162664F2

8B934F0C EB60A7FE 81D7D5EF BB8F1673

F67D69C7 C5E21B19 42E7EFBD D9C2BBC1

CEBA4697 535E29CA 0D2D0D4D ACE548CE

07815DC7 BDE3901E D5D198E4 BC1677C0

46097A55 29BCE0C9 72A358E8 CEFEEFB5

24CEB623 D7232749 F2515349 FB675F93

C55635A7 B1E32AB0 3D055979 041E0359

------ END LICENSE ------

----- BEGIN LICENSE -----

Esri, Inc

19 User License

EA7E-853424

BBB0D927 00F6E4AB 0AFFEFEA 82C4A3E5

4F9A99D1 7C0475AB 5A708861 6C81D74E

4BBA1F56 877CE0E2 88126328 486D8600

8A0A85D7 49671882 49969D92 312F27A7

5CCAE55B D711D4E2 9069DE55 B510370C

9499567E 61D548BA FB260403 711DFE24

1BAFDA6D 1F52E6B1 B728EF5B A40CCD4D

FD716AF5 1760D208 0E05F26E 22660950

------ END LICENSE ------

----- BEGIN LICENSE -----

Dylan Tittel

Single User License

EA7E-898127

CD1A23C0 E8687245 18A89BFA 7CF52C10

A20AA536 9E1A57C7 D33839DC 6613C428

91E9C7FF F4702893 251C6403 27A10818

6F48AC9C BB66843D C1D60DEA B952C2D0

40019115 E5278B04 95EBB709 D6B1C5B9

67CA940A 88701851 32910570 57AD5B96

263A8906 AFBFAB46 52F6706F CACFC74E

DFAD4752 D10E58B6 744B90F2 13AF2B9C

------ END LICENSE ------

----- BEGIN LICENSE -----

Country Rebel

Single User License

EA7E-993095

19176BCE 3FF86EA0 3CE86508 6BE4DCA7

9F74D761 4D0CAD8B E4033008 43FC73F3

1C01F6DD C4829BE9 E7830578 A4823ADC

61B224F1 DC93C458 ABAAAE0F 925C32D4

04A83C36 813FF6C8 9877942C 4418F99C

2F15E5B8 544EDB80 D9A86985 4CBBA6A8

998DE3E4 7FB33E15 6CD30357 6DC96CEA

ECB1BC4E D8010D5A 77BA86C8 BA7F76CC

------ END LICENSE ------

#插件安装

2.1Package Control组件

control+~调出控制台


粘贴以下代码到底部命令行并回车:

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

重启sublime text3

#gcc安装

3.1brewinstall gcc

等待安装完成

3.2输入命令gcc -v验证是否安装成功,如果安装成功,应该有以下提示:

Configuredwith:--prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1AppleLLVMversion6.1.0(clang-602.0.49) (based onLLVM3.6.0svn)Target:x86_64-apple-darwin14.3.0Threadmodel:posix

#配置sublime text的C语言编译系统

4.1打开Tools->Build System->New Build System,在新建的文件中输入以下内容:

{"cmd":["gcc -o ${file_base_name} $file_name"],"shell":true,"working_dir":"$file_path","selector":"source.c","encoding":"utf-8","variants":[{"name":"Run","cmd":"./${file_base_name}"}]}

将这一段复制粘贴,保存成C.sublime-build。

再创建一个新的.c文件,如helloworld.c,cmd+b编译,shift+cmd+b运行,即可。



5.1Mac OS �Sierra 配置sublime text3 C语言开发环境完成

推荐阅读更多精彩内容