C++ COMPILER/IDE INSTALLATION PROCESS
Step 1: Choose a C++ Compiler/IDE
Popular options include:
- Microsoft Visual Studio
- Code::Blocks
- MinGW (GCC)
Step 2: Download the Compiler or IDE
For Microsoft Visual Studio:
1. Visit the [Visual Studio download page](https://visualstudio.microsoft.com/downloads/).
2. Click "Free download" under Visual Studio Community Edition.
For Code::Blocks:
1. Visit the [Code::Blocks official website](https://www.codeblocks.org/downloads/).
2. Download the version bundled with MinGW (recommended for beginners).
For MinGW (GCC):
1. Go to the [MinGW-w64](https://mingw-w64.org/doku.php) website.
2. Download the installer for Windows.
Step 3: Install the Chosen Compiler/IDE
Installing Visual Studio:
1. Run the downloaded installer.
2. Select the "Desktop development with C++" workload.
3. Follow prompts to complete the installation.
Installing Code::Blocks with MinGW:
1. Run the installer.
2. Follow the setup instructions; ensure the MinGW compiler is selected and installed.
Installing MinGW separately:
1. Run the MinGW-w64 installer.
2. Choose the architecture (64-bit or 32-bit).
3. Select the installation directory.
4. Once installed, add the bin folder (e.g., `C:\mingw-w64\bin`) to your system's PATH environment
variable.
Step 4: Verify the Installation
1. Open Command Prompt.
2. Type `g++ --version` and press Enter.
3. If installed correctly, you should see the version information.
Step 5: Write and Compile a Simple C++ Program
1. Open your IDE or a text editor (e.g., Notepad++).
2. Write a simple program:
```cpp
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
```
3. Save as `hello.cpp`.
4. Compile:
- Using command prompt, navigate to the directory containing `hello.cpp`.
- Run `g++ hello.cpp -o hello.exe`.
5. Run the program:
- Type `hello` and press Enter.