当前位置:网站首页>Download and installation configuration of cygwin

Download and installation configuration of cygwin

2022-07-01 03:38:00 Three Belle Wenzi

Catalog

One 、Cygwin Introduce

1. What is? Cygwin

2. Cygwin The building blocks of

3. Cygwin How it works

Two 、 Cygwin Download and install

3、 ... and 、 Configure environment variables

Four 、 Cygwin The uninstall

1. Remove services already installed on your computer

2. Stop all on the computer about Cygwin The background program of

3. Delete Cygwin root directory

4. Delete shortcut

5. Delete system environment variable path Item in

6. Delete the key in the registry


 

One 、Cygwin Introduce

1. What is? Cygwin

        Cygwin It's a windows Classes running on the platform UNIX Simulation environment , yes cygnus solutions company-developed The free software ( The famous tools developed by the company include eCos, But now it has been Redhat Acquisition ). It's for learning UNIX/Linux Operating environment , Or from UNIX To Windows Application porting for , Or do some special development work , Especially in use GNU The toolset is in Windows on Embedded system development , Very useful . With the development of embedded system, it becomes more and more popular in China , More and more developers are interested in Cygwin There was interest . 

        Cygwin Provide a UNIX  simulation DLL And a variety of functions built on its upper layer Linux Software packages found in the system , stay Windows XP SP3 The above versions provide good support .Cygwin Mainly by Red Hat And its subordinate communities are responsible for maintenance .

         Then you will ask , stay Windows Installation on Cygwin What is it ? What's the use of ? In fact, it is very useful , Like we're using eclipse When the platform is developing plug-ins , Suppose you are going to make one in eclipse Can compile on the platform C/C++ Integrated development environment of program ( Plug in ), Then you need to use the plug-in CDT, Be similar to Java Development environment plug-ins JDT, So you are in eclipse There are plug-ins CDT, You need your computer to run gcc、g++、gdb Wait for your order , here , our Cygwin It works ,【 If you want to be in eclipse Develop a C/C++ Integrated development environment , Then you need to combine :eclipse + CDT plug-in unit + Cygwin】.

2. Cygwin The building blocks of

        Cygwin Including a set of libraries , The library is located in Win32 Under the system POSIX system call Of API; There's another set GNU Development toolset ( such as GCC、GDB), In this way, simple software development can be carried out ; Some more UNIX Common programs under the system .2001 year , Added X Window System.

         Another one is called MinGW The library of , Can follow Windows The local MSVCRT library (Windows API) Working together .MinGW Take up memory 、 Hard disk space is relatively small , Ability to link to any software , But it's right. POSIX The implementation of the specification does not Cygwin The library is complete .

         But the bad thing is ,Cygwin I won't support it Unicode. actually , Except for the present Windows System and OEM codepages( for example , A Russian user , His code page is CP1251 and CP866, And can't be KOI8-R、ISO/IEC 8859-5、UTF-8 etc. ),Cygwin No other character sets are supported .Cygwin The newer version of can meet the display requirements through the settings of the built-in terminal simulator UTF-8 And more code page functions .

        Red Hat Regulations ,Cygwin Library compliance GNU General Public License, But it can also be linked to free software that meets the definition of open source .Red Hat There are also expensive license agreements , Use this way Cygwin Proprietary software for the library , It can be republished .

3. Cygwin How it works

        cygnus First of all gcc,gdb,gas And other development tools , Enable them to generate and interpret win32 The target file of . then , They want to transplant these tools to windows Get on the platform . One solution is based on win32 api Make major changes to the source code of these tools , This obviously requires a lot of work . therefore , They took a different approach —— They wrote a shared library ( Namely Cygwin dll), hold win32 api Not found in unix Style call ( Such as fork,spawn,signals,select,sockets etc. ) Encapsulated inside , in other words , They are based on win32 api Wrote a unix Simulation layer of system library . such , Just connect the source code of these tools with this shared library , You can use unix Host computer Cross compiler To generate windows The toolset running on the platform . With these transplanted to windows Based on the development tools on the platform ,cygnus And gradually put other tools ( There is little need to modify the source code , Just modify their configuration scripts ) The software is ported to windows come up . such , stay windows Run on the platform bash And development tools 、 User tools , It feels like unix To work on .

 

Two 、 Cygwin Download and install

        In the first section we know Cygwin The function is in Windows Similar to the implementation UNIX Operating system compilation and debugging simulation environment , That is to say Windows Can also be used on gcc、g++ To compile the program . So in this section , Let's learn about this Cygwin Installation process :

  First step : download  Cygwin Installation, Open after download setup-x86_64.exe file , The following screen appears .

840dba0bdbba4d0988487a67adf8776c.png

  Click on “ next step (N)” Show me the interface , On this interface , We can see that there are three installation modes , Namely :

  • Install from Internet: This model is directly from Internet Installed , Suitable for computers with internet ;
  • Download Without Installing: This model can only be downloaded from the Internet Cygwin The component package of , But not installed ;
  • Install from Local Directory: This mode corresponds to the second mode above , When your Cygwin The component package has been downloaded locally , You can use this mode to install... Locally Cygwin.

  Choose the appropriate installation mode from the above three modes , Let's start with the first mode , Install directly from the Internet , Of course, while downloading ,Cygwin Components are also saved locally , It is convenient to install again in the future , After selection , Click on “ next step (N)”. 

23c7b3e8f02f4eb59a3355b0bc0e4c1f.png

  The second step : choice Cygwin Installation directory , And some parameter settings . The default installation location is C:\cygwin\, You can also choose your own installation directory , And then choose “ next step ”, Xiaobian is installed in D:\IDE\Cygwin\Source.

4f7e71c79b4f43128e3eeee8715fd18b.png

Next, we can choose to download from the Internet during the installation process Cygwin Save location of component package , After selection , Click on “ next step ”, Xiaobian places the component package to be saved in D:\IDE\Cygwin.

dee759d9ded643e5b4cffe5bfdea1d50.png

  The third step : This step selects the connection method , Choose your connection method , And then click next , A dialog box for selecting a download site will appear , As shown in the figure below .

990f26bdc65c4cadab12fc95f9a484f0.png

This step selects the first 163 The mirror website provided can , The download speed in China is very fast , If there are other images , You can enter URL after , Click on “Add” Add , Then select... In the list . After selection , Click on “ next step ”, After downloading several files, the following interface appears :

658630a11c494849866631e08cdbc588.png

Step four : Enter the following interface , Here is the download from this interface. We need to compile C/C++ Code Packages, We just need to download “Devel” Just branch off a few packages :

    gcc, 
    gcc-core, 
    gcc-g++, 
    gcc-mingw-core, 
    gcc-mingw-g++, 
    make , 
    gdb, 
    binutils

    In the picture above search Box gcc, The program will automatically search , Here's the picture , By choice “Devel” Package under Branch , Find and install the package we need , And then click Skip To choose the latest installation package .

 f3ff6b4300b046f3ac1c7ebc5b0c303e.png

  Step five : Waiting for the installation , The installation time depends on the components you choose and the network . After installation , The installer will prompt if you want to create... On your desktop Cygwin Icon, etc , Click Finish to exit the installer .

af365281d7f84baa96a5a6521c2c98c5.png

installation is complete :

0341a2da30a84c019ee71d8303f82ea4.png

3、 ... and 、 Configure environment variables

Open the environment variable on the computer , Then, in the system variables field path Add in variables Cygwin Under the installation path of bin route :

14aabd1c4b534150b0e3b8032bf9026c.png

  After configuring environment variables , Open command window Win+R, Input gcc perhaps g++, If it does not appear, if displays “ Access denied ” (access denied), It means the installation is successful , If appear “ Access denied ” (access denied), So the solution is : Get into cygwin The installation directory \bin Lower inspection g++.exe, gcc.exe Whether only 1k size , If it is , Then the file is a symbolic link , Then rename the file ( Backup ). And then put g++-3.exe( perhaps g++-4.exe) Copy a , Rename it to g++.exe. hold gcc-3.exe Copy a , Rename it to gcc.exe.  

7bc382400e7644fb9659ad54d0f9f237.png

 

Four 、 Cygwin The uninstall

Uninstall completely Cygwin, because Cygwin The installer for does not provide the option to uninstall , So we need to delete it manually Cygwin The relevant documents of . The methods recommended on the official website are as follows :

1. Remove services already installed on your computer

In the installation Cgywin Common services may be installed when , image  sshd、cron、cygserver、inetd、apache、postgresql etc. , Delete these services .

2. Stop all on the computer about Cygwin The background program of

Stop the background running on the computer Cygwin Program , Make sure that there is no problem that the file cannot be deleted when it is deleted .

3. Delete Cygwin root directory

The default is C:\Cygwin, Delete the entire directory . If the prompt file is occupied, it cannot be deleted , Check carefully to see if there is Cygwin The relevant program is still running , If you can't, just restart and delete .

4. Delete shortcut

Delete the shortcuts on the desktop and in the start menu .

5. Delete system environment variable path Item in

If environment variables are added during installation , Then we need to delete these items manually . Main inspection path Are there any and Cygwin Related items .

6. Delete the key in the registry

Open registry editor ( Can be found with the search function ), Respectively in HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER Find below Software , And then in Software Find Cygwin , Just delete this item .

 

 

 

 

 

原网站

版权声明
本文为[Three Belle Wenzi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207010318436312.html