Build a Linux C language development environment

Source: Internet
Author: User

1. Operating system

Windows operating systems: Windows 7 and Windows 10

2. Development tools and compilation tools

Development tools: notpad++ and Vim

Compilation tool: Cygwin64 Terminal

3. Tool installation

1) Download notpad++ and Cygwin64 Terminal directly in Baidu

2) refer to the online installation method for Cygwin64 terminal, install vim and GCC

To see if the installation of Vim and GCC was successful:

$ gcc--version
GCC (GCC) 4.9.3
Copyright? Free Software Foundation, Inc.
This procedure is free software; Please refer to the copyright notice of the source code. The software does not have any warranties;
Includes no warranties of merchantability and fitness for a particular purpose.

$ vim--version

Vim-vi Improved 7.4 (compiled OCT 8 2015 00:46:23)
Includes patches: 1-801, 803-808, 810-891
Compiled by <[email protected]>

4.Hello World

The Linux C language and other C languages write Hello World in the same way that the code looks like:

1234567 #include<stdio.h>int  main(void){    printf("Hello World!!");    return0;}

With the introduction of the Stdio header file, you can call the printf function to print something to the terminal.

5. Compiling and Running

Compiling is simple, using the GCC compiler that was previously installed to:

[Email protected]/cygdrive/e/c_study/helloworld
$ gcc Main.c-o Hello

Description

1) You can view the parameter description of the compilation tool via GCC--help

2) After GCC need to connect source source code, can contain multiple files

3)-O followed by the target file, which is the final executable file

After compiling, this directory tree looks like this:

$ ls
Hello.exe MAIN.C

The target file is an. exe suffix because of the use of Windows system development

Operation Result:

$./hello.exe
Hello world!!

The output is the familiar Hello World, the content printed through printf.

Summarize:

The above initial completion of the Linux C language development environment to build, compile and execute the necessary preparations, the following start learning Linux C language from scratch.

Build a Linux C language development environment

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.