Let your sublime text write C code (sublime text 2 configuration Build C development environment)

Source: Internet
Author: User

Principle
    • 1. First you have to configure the C++/C environment to be able to compile
    • 2. The environment variables of the execution environment are configured in window and can be used globally
    • 3. Sublime text creates a new build mechanism. and set the global compilation environment with a change
Specific process
    • The ability to compile C + + environments. We install MinGW to download Mingw-get-setup and install it on my network first. I was installed by default. The path after installation is C:\MinGW
    • Set the path of the MinGW in the window environment variable, in detail to see a paste. Then check to see if you can use g++ in window. Beat the g++-v command in CMD. Assuming that g++ is not a system command, it proves that your g++ has not been installed successfully.

      There are two reasons why this problem occurs:
      1. Installation finished MinGW but you did not install g++ (may need to be checked during installation). We can use this command to install g++. At cmd knock Mingw-get install g++
      2. The environment variable you set does not take effect. I had to restart the computer before it worked.

    • On the sublime Text, new Build System. Details are tools| Build System|new Build System creates a c.sublime-build. How to configure it? Please see source code c.sublime-build (may need to FQ), can also download c.sublime-build on my network disk.

      And put your c.sublime-build file in preferences|. Browse packages| In user

    • Create a new C file and write a simple introductory C code
      #include <stdio.h>int main (void) {printf ("Hello world\n"); return 0;}
      After saving press the shortcut key CTRL + B is compiled, then CTRL + SHIFT + B. A console will appear

Acknowledgements Sublime Text 2 configuration compilation C language
Sublime Text 2 && MinGW g++ on Windows
Sublime text 2 in Windows Building C + + surrounding environment

Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Let your sublime text write C code (sublime text 2 configuration Build C development environment)

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.