当前位置:网站首页>Download and installation configuration of cygwin
Download and installation configuration of cygwin
2022-07-01 03:38:00 【Three Belle Wenzi】
Catalog
2. Cygwin The building blocks of
Two 、 Cygwin Download and install
3、 ... and 、 Configure environment variables
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
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 .

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)”.

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.

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.

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 .

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 :

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 .

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 .

installation is complete :

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 :

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.

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 .
边栏推荐
- FCN全卷積網絡理解及代碼實現(來自pytorch官方實現)
- [us match preparation] complete introduction to word editing formula
- 4. [WebGIS practice] software operation chapter - data import and processing
- 数据库中COMMENT关键字的使用
- 数据交换 JSON
- LeetCode 31下一个排列、LeetCode 64最小路径和、LeetCode 62不同路径、LeetCode 78子集、LeetCode 33搜索旋转排序数组(修改二分法)
- JS daily development tips (continuous update)
- 力扣-两数之和
- 雪崩问题以及sentinel的使用
- 监听器 Listener
猜你喜欢

Explain spark operation mode in detail (local+standalone+yarn)

Test function in pychram

BluePrism注册下载并安装-RPA第一章

Overview of EtherCAT principle

ASGNet论文和代码解读2

Cookie&Session

Leetcode 31 next spread, leetcode 64 minimum path sum, leetcode 62 different paths, leetcode 78 subset, leetcode 33 search rotation sort array (modify dichotomy)

还在浪费脑细胞自学吗,这份面试笔记绝对是C站天花板

Basic concepts of database

How to achieve 0 error (s) and 0 warning (s) in keil5
随机推荐
Database DDL (data definition language) knowledge points
网页不能右键 F12 查看源代码解决方案
Appium自动化测试基础 — APPium基本原理
go实现命令行的工具cli
过滤器 Filter
Learning notes for introduction to C language multithreaded programming
【伸手党福利】JSONObject转String保留空字段
RSN:Learning to Exploit Long-term Relational Dependencies in Knowledge Graphs
Golang multi graph generation gif
ASGNet论文和代码解读2
How do I use Google Chrome 11's Upload Folder feature in my own code?
How to achieve 0 error (s) and 0 warning (s) in keil5
访问阿里云存储的图片URL实现在网页直接预览略缩图而不直接下载
数据交换 JSON
Nacos
Introduction to EtherCAT
jeecgboot输出日志,@Slf4j的使用方法
5. [WebGIS practice] software operation - service release and permission management
GCC usage, makefile summary
Leetcode 128 longest continuous sequence (hash set)