Last active
March 6, 2023 19:42
-
-
Save grpnpraveen/59f466924c15bee7a2d7697607658809 to your computer and use it in GitHub Desktop.
How to run an OpenGL cpp file from Terminal ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I Used GLEW and GLFW for this | |
# @Note I used MSYS2 for this , to download glfw and glew using MSYS2 use below commands | |
# pacman -S mingw-w64-x86_64-glfw and pacman -S mingw-w64-x86_64-glew | |
# for cpp compiler I used MinGW which can also be downloaded in MSYS2 | |
# Step 1: to generate obj file , basically only compiling | |
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o main.obj main.cpp | |
## Command 1 description | |
## -O0 means optimisation level 3 , -g3 debugging level 3, -Wall to print all warnings, -c only compile | |
# Step 2: | |
g++ -o main.exe main.obj -lglfw3 -lglew32 -lopengl32 -lglu32 -lfreeglut | |
## Command 2 description | |
## -lglfw3 linking the glfw3.dll glew32.dll opengl32.dll glu32.dll |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
init