Set up C development environment with sublime Text 2 under Mac

Source: Internet
Author: User
Tags sublime text

Xcode on your Mac is a fairly large IDE that can be developed quite a lot. But as programmers, there are times when we expect the Boulevard-to-Jane-a GCC compiler, a text editor. This is all the tools we expect when we learn the C language. (As for the Mac's vi really good, follow-up opportunity will also write some VI experience). Sublime Text 2 below.

(1) First we need to install GCC on the Mac, the method of self-baidu--of course, our Mac should be installed Xcode,xcode bring GCC, all with the XCODE,GCC installation this step is omitted.

(2) After installing sublime text 2, we do not see the result of C running in sublime Text 2. Then we need to configure the build System.

In sublime text, click Tools, build System, NEW build system ... A template that pops up a profile replaces the content in the template with the result:

 
{

    "cmd" : ["gcc $file_name -o ${file_base_name} && ./${file_base_name}"],

    "selector" : "source.c",

    "shell" : true,

    "working_dir" : "$file_path"

}

Then save to C.sublime-build, the location by default.

At this point, we can sublime text 2 to write a good program and run the program directly.

Set up C development environment with sublime Text 2 under Mac

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.