-
GLFW
- Download GLFW from here
- Extract the downloaded file
- Copy folder to
C:\glfw-3.4.bin.WIN32\
-
GLEW
- Download GLEW from here
- Extract the downloaded file
- Copy folder to
C:\glew-2.1.0\
- create
c_cpp_properties.json
file - create
tasks.json
file
- copy the
main.cpp
file to the project directory
{
"configurations": [
{
"name": "windows-gcc-x86",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C:/MinGW/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x86",
"compilerArgs": [
""
]
}
],
"version": 4
}
{
"tasks": [
{
"label": "C/C++: gcc.exe build active file",
"type": "cppbuild",
"command": "C:/MinGW/bin/gcc.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"-I",
"C:\\glfw-3.4.bin.WIN32\\include",
"-I",
"C:\\glew-2.1.0\\include",
"-L",
"C:\\glew-2.1.0\\lib\\Release\\x64",
"-L",
"C:\\glfw-3.4.bin.WIN32\\lib-mingw-w64",
"-lglfw3dll",
"-lglew32",
"-lopengl32",
],
"options": {
"cwd": "C:/MinGW/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt -I C:\\glfw-3.4.bin.WIN32\\include -I C:\\glew-2.1.0\\include -L C:\\glew-2.1.0\\lib\\Release\\x64 -L C:\\glfw-3.4.bin.WIN32\\lib-mingw-w64 -lglfw3dll -lglew32 -lopengl32 && ./$fileNameWithoutExt",
- Add
glfw3.dll
to the project directory fromC:\glfw-3.4.bin.WIN32\lib-mingw-w64
- Open the project directory in the terminal
- Run the following command
g++ main.cpp -o main -I C:\glfw-3.4.bin.WIN32\include -I C:\glew-2.1.0\include -L C:\glew-2.1.0\lib\Release\x64 -L C:\glfw-3.4.bin.WIN32\lib-mingw-w64 -lglfw3dll -lglew32 -lopengl32 && ./main
- -Bijay Shrestha (GitHub), March-2024