-
Install MinGW:
- Go to the MinGW-w64 download page or Download Using MinGW-w64 download page.
- Download and install the appropriate version.
- Run the terminal MSYS2 or type MINGW.
- In that terminal run this command
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchainand enter.- Accept by pressing Y.
- After updating MSYS2 we then paste this command
pacman -S mingw-w64-ucrt-x86_64-gcc- This installs the gcc compilers for your projects.
- To view after installing just type
gcc --version.
- Add the path of your MinGW-w64 bin folder to the Windows PATH environment variable.
- Press Windows Key and type Edit Environment Variables.
- Either in User or System, select PATH and Edit.
- Make New and add the path for your MINGW, default is:
C:\msys64\ucrt64\bin
- Press Windows Key and type Edit Environment Variables.
-
Verify Installation:
- Open Command Prompt and type:
gcc --version g++ --version gdb --version
- You should see the installed version of
g++.
- Open Command Prompt and type:
-
Install Xcode Command Line Tools:
- Open Terminal and type:
xcode-select --install
- Open Terminal and type:
-
Verify Installation:
- In Terminal, type:
g++ --version
- The installed version of
g++should be displayed.
- In Terminal, type:
-
Install GCC:
-
For Debian/Ubuntu-based systems:
sudo apt update sudo apt install build-essential
-
For Red Hat/CentOS-based systems:
sudo yum groupinstall 'Development Tools'
-
-
Verify Installation:
- In Terminal, type:
g++ --version
- In Terminal, type:
Follow the Guide in VSCode to Setup GCC in your IDE
- Recommend to install these Extensions:
- Code Runner
- C/C++
- Then make your first program:
- When running the first time
Run C/C++ Fileselect the debug C/C++:g++.exe - It will become default and will add to your task.json and settings.json
- When running the first time
- First let's download GLAD from the website: GLAD
- Language: C/C++
- Specification: OpenGL
- API:
- gl: Version 3.3
- Profile: Core
- Generate
- Download ONLY glad.
- Bring all the files from glad.zip to your "Working Project"
- First let's download GLAD from the website: GLFW
- Download the Pre-Compiled Binaries from your OS System
- Inside the zip folder go towards glfw-[version].bin.[OS] then include and copy the GLFW to the include folder from your "Working Project" that we gradded from GLAD
- Now go back and find the folder called "lib-mingw-w64"
- Create a new folder inside of the "Working Project" called "lib" and drag a file called libglfw3dll.a into it.
- create another folder called "bin" in your "Working Project" and drag the file called "glffw3.dll" to that folder.
Our main.cpp file is going to be located in the src folder where it contains the file glad.c.
In the same repo, we are providing you a "template" for setting up your .vscode to setup C++ and OpenGL
The Makefile is going to be located in the bin folder where we will be compiling our program and run it.
Remember to change the settings inside to contain the correct path for the libraries and main.cpp