C/C++ development, compilation environment construction

Table of contents

1. MinGW (win)

2. Cygwin(win) 

3. Pure linux environment


1. MinGW (win)

        Enter Downloads - MinGW-w64 download page, select MinGW-w64-builds to jump to download,

        Jump again:

         Then enter the download page ( WinLibs - GCC+MinGW-w64 compiler for Windows ), drop down to the Download title, and download as needed. This article chooses the compiled WIN toolkit

        This article is downloaded as follows:

         Unzip the toolkit to a path without Chinese characters or special characters, such as this article:

         Enter the environment variable configuration page, add the mingw path in the path environment variable:

         Run the command tool to test whether gcc -v and g++ -v are in effect, as shown in the figure below

2. Cygwin (win) 

        The same is still the ( Downloads - MinGW-w64 ) download page, select the Cygwin option to jump

        Select setup.exe to install the toolkit, jump,

         Enter ( Cygwin Installation ) page, download

        After the download is complete, get the .exe file for direct installation

        Double-click to install, and follow the installation instructions to guide. The path setting should not contain Chinese characters and special symbols. The installation in this article is as follows:

         After the installation is complete, you can also configure the environment variable. In this article, the variable is set first, and the path environment variable is introduced.

         If you have not created a desktop shortcut for Cygwin,

        You can manually create this shortcut by entering the path yourself.

         Double-click the shortcut to start and enter a command window of the win compilation tool running on a linux-like system, and test whether it supports c/c++ compilation through gcc -v or g++ -v. 

        Then the windows disk file is in the "/cygdrive" directory:

         In addition, you can right-click the window and select the options item to enter the window settings, such as window size, font, etc., save and restart to take effect.

3. Pure linux environment

        This article is realized by using VMware® Workstation 15 Pro+ to install the centos7 desktop version system. For specific installation, please refer to other blog posts, and then run gcc -v or g++ -v to test compilation support:

        In addition, some other linux systems have been tested by myself, and they all support c++11 and above, but some may support the new c++20 and c++23 standards, which will be more troublesome

 

Guess you like

Origin blog.csdn.net/py8105/article/details/129844783