Learn one of the Linux learning notes based on Cygwin: introductory article

Source: Internet
Author: User

Recently began to learn Linux, do not want to toss a dual system or virtual machine, followed by a Cygwin in the Windows simulation Linux environment.

First, install some common plug-in packages: Make, gcc, g++, awk, sed, vim, and so on.

First of all, the next Cygwin under the Vim key and the back key can not be used:

Go to the Vim74 folder (specifically vim73,74 or future later versions will be the case):

$ cd/usr/share/vim/vim74

To set VIM:

$ cp Vimrc_example.vim  ~/.VIMRC

The key words of the programming language in Vim have also been added color, great.

Create a CPP file with vim

First create the file:

$ vim helloworld.cpp</span>
after entering vim, enter I into the edit mode, the relevant code is as follows:

#include <iostream>int main () {      std::cout<< "helloworld!\n";      return 0;}
tap ESC to exit Edit mode

Enter ":" To accept the command

Save and launch Vim

Wq
to compile the CPP file (the default compilation output file is named A.exe, where I rename the output file to Mycpp via-o mycpp)

$ g++-O mycpp HelloWorld.cpp
run the compiled file

$./mycpp.exe
successfully print out:
helloworld!

As the film for reference:





Learn one of the Linux learning notes based on Cygwin: introductory 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.