In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how MinGW uses GNU on Windows". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how MinGW uses GNU on Windows".
Install the GNU compiler collection (gcc) and other GNU components on Windows to enable GNU Autotools.
If you are a hacker using Windows, you do not need proprietary applications to compile code. With the Minimalist GNU for Windows (MinGW) project, you can download and install the GNU Compiler Collection (GCC) and several other basic GNU components to enable GNU Autotools on Windows computers.
Install MinGW
The easiest way to install MinGW is through mingw-get, a graphical user interface (GUI) application that helps you choose which components to install and keep them up to date. To run it, download mingw-get-setup.exe from the project home page. Just like you installed other EXE, click finish installation in the wizard.
Installing mingw-get
Install GCC on Windows
So far, you have installed only one program, or more accurately, a dedicated package manager called mingw-get. Start mingw-get to select the MinGW project application to install on your computer.
First, select mingw-get from the application menu to start it.
Installing GCC with MinGW
To install GCC, click GCC and the Gateway + package to mark the installation of GNU C, C++ compilers. To complete this process, select apply changes from the installation menu in the upper left corner of the mingw-get window.
After installing GCC, you can run it in PowerShell using the full path:
PS > C:\ MinGW\ bin\ gcc.exe-- versiongcc.exe (MinGW.org GCC Build-x) x.y.zCopyright (C) 2019 Free Software Foundation, Inc. Run Bash on Windows
Although it calls itself "minimalist" (minimized), MinGW also provides an optional Bourne shell command line interpreter called MSYS (which represents the minimum system Minimal System). It is an alternative to Microsoft's cmd.exe and PowerShell, and it defaults to Bash. In addition to being (naturally) one of the most popular shell, Bash is useful for porting open source applications to the Windows platform because many open source projects assume a POSIX environment.
You can install MSYS in mingw-get GUI or PowerShell:
PS > mingw-get install msys
To try Bash, start it with the full path:
PS > C:\ MinGW\ msys/1.0/bin/bash.exebash.exe-$ echo $0 "C:\ MinGW\ msys/1.0/bin/bash.exe" set the path on Windows
You may not want to enter the full path for each command you want to use. Add the directory containing the new GNU executable to the path in Windows. You need to add two executable root directories: one for MinGW (including GCC and its associated tool chains) and one for MSYS (including many common tools in Bash, GNU, and BSD projects).
To modify the environment in Windows, click the apply menu and enter env.
Edit your env
This opens the preferences window. Click the Environment variables button near the bottom of the window.
In the Environment variables window, double-click the path selection in the bottom panel.
In the Edit Environment variable window, click the New button on the right. Create a new entry C:\ MinCW\ msys\ 1.0\ bin, and then click OK. Create the second C:\ MinGW\ bin in the same way, and then click OK.
Set your env
Accept these changes in each preference window. You can restart your computer to make sure that all applications detect new variables, or simply restart the PowerShell window.
From now on, you can call any MinGW command without specifying the full path, because the full path is in the% PATH% environment variable of the Windows system that PowerShell inherits.
Hello world
You have completed the setup, so you can test the new MinGW system. If you are a Vim user, please start it and enter the following "hello world" code:
# include # include using namespace std; int main () {cout.\ a.exeHello open source.PS >
The content of MinGW is much more than I can introduce here. After all, MinGW opens up a complete open source world and the potential for custom code, so make the most of it. For the wider open source world, you can also try Linux. When all the restrictions are removed, you will be surprised at what is possible. But in the meantime, try MinGW and enjoy the freedom of GNU.
Thank you for your reading, the above is the content of "how MinGW uses GNU on Windows". After the study of this article, I believe you have a deeper understanding of how MinGW uses GNU on Windows, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.