---
tags: sem1
---
# OpenGL with MSYS2
## Compiling with MSYS2-mingw64
An portable environment is prepared with required packages installed. It can be downloaded from [https://drive.google.com/file/d/1NgcwiBo1Bb-kCoj--vNWhPg9bg7vmm0n/view](https://drive.google.com/file/d/1NgcwiBo1Bb-kCoj--vNWhPg9bg7vmm0n/view)
## Getting Started
1. Extract the zip files and put it anywhere (refers to it as ``$MSYS` from now on)
2. A MinGW64 shell is needed to run the commands. (click on `mingw64.exe`)
- Note: home directory is located at `$MSYS/home/{your_username}`
3. Run `git clone https://github.com/yurisoba/cgfinal`
- This will be locaated at `$MSYS/home/{your_username}`, you can open this folder with VSCode or VS2019 etc., ignore the errors in the code since we will be building it differently
4. For the first time, do `mkdir build && cd build && cmake .. && ninja`. This will generate the configurations and build it.
5. To run it, ensure the current directory is at `$MSYS/home/{your_username}/cgfinal` instead of `$MSYS/home/{your_username}/cgfinal/build`. (One level above the `build` directory)
6. To build it, you have to go back into the `build` directory and run `ninja`.