PDF download Download Article PDF download Download Article

Installing and configuring OpenGL, GLFW, GLEW, and GLM, as well as starting your first project in Visual Studio 2022 using the GLFW-GLEW-GLM Template, are the first hurdles that this article will help you overcome. It will presume that you are running Windows 10 or 11. Click "Language pack" and select "English" in addition to checking the "Desktop development with C++ workload" box during the Visual Studio installation. It is meant for the novice. Three methods exist for him to set up GLFW-GLEW-GLM in a Visual Studio project: the first targets the x32 platform, the second the x64 platform, and the third sets up the GLFW-GLEW-GLM source that has been compiled using CMake and Visual Studio. Visual Studio 2022 is by default x64; however, x32 (x86) can be used in its place.

Part 1
Part 1 of 19:

Configuring Visual Studio

PDF download Download Article
  1. 1
    Emphasize a step or a substep. Point to the step or steps you intend to complete, then carry them out. View the above image as an example.
  2. 2
    Install Visual Studio 2022. You can get it from https://www.visualstudio.com/downloads if you haven't already.
  3. Advertisement
Part 2
Part 2 of 19:

Downloading GLFWx32, GLEWbin, and GLM

PDF download Download Article
  1. 1
    Create folders GL and GLP. Open Windows's File Explorer > Navigate to disk (directory) C.
    • It's okay if the folders GL and GLP exist.
    • If not, perform a right-click in an empty space. > select New > Folder > type GL > hit Enter . Create the GLP folder in the same manner.
  2. 2
    Download GLFW. Open Link in New Window will appear when you right-click on the following address https://www.glfw.org/download.html . It is the URL.
    • Click 32-bit Windows binaries . You will get "glfw-3.4.bin.WIN32.zip" or the latest version.
    • Open folder C:\GL
    • In downloading window click folder "glfw-3.4.bin.WIN32" > click it again and drag into folder C:\GL.
    • Once the folder has completed copying and pasting, copy GLFWx32 > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Close the new "File Explorer" window > close the GLFW window.
  3. 3
    Download GLEWbin. Right click on the following link and select Open Link in New Window http://glew.sourceforge.net/ .
    • Below Downloads , find Binaries and click Windows 32-bit and 64-bit .
    • Open folder C:\GL
    • In downloading window click folder "glew-2.1.0" > click it again and drag into folder C:\GL.
    • Once the folder has completed copying and pasting, copy GLEWbin > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Close the new "File Explorer" window > close the GLEW window.
  4. 4
    Download GLM. Right click on the following address and select Open Link in New Window https://glm.g-truc.net/0.9.9/index.html .
    • In the upper left corner click Download GLM 0.9.9.7 or latest version (see above picture).
    • Open folder C:\GL.
    • In downloading window click folder "glm" > click it again and drag into folder C:\GL.
    • Once the folder has completed copying and pasting, copy GLM > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Now in folder GL you have folders GLFWx32 , GLEWbin , and GLM .
    • Close the new "File Explorer" window > close the GLM window.
  5. Advertisement
Part 3
Part 3 of 19:

Creating Project targeting x32 Platform

PDF download Download Article
  1. 1
    Create empty project.
    • If Visual Studio is not open . Open it > click Create a new project .
      • In Create a new project wizard, find Empty Project Start from scratch with C++ for Windows. Provides no starting files. (see image above. If it's not visible, enter its name in the search bar above the list and press Enter ) > click it > click Next .
      • In Configure your new project wizard for "Project name" type (or copy and paste) GLFWx32-GLEWx32-GLM-0
      • Copy C:\GLP and paste in "Location" text field.
      • Check "Place solution and project in the same directory".
      • Click Create .
      • Wait till Visual Studio instance appears.
    • If Visual Studio is open . In main menu click File > New > Project… > the rest as above..
    • In "Solution Explorer" window right click the "Source Files" folder (the last one) > click "Add > "New Item…"
    • In the "Add New Item" wizard instead of "FileName", type Main > hit Enter . The source file Main.cpp will open in the main text editor but leave the file blank for now.
  2. Advertisement
Part 4
Part 4 of 19:

Setting up GLFWx32, GLEWx32, and GLM in the Project

PDF download Download Article
  1. Go to "Solution Explorer" > right click on the name of your project GLFWx32-GLEWx32-GLM-0 > select "Properties" (the last one). In "GLFWx32-GLEWx32-GLM-0 Property Pages" wizard,
  2. 2
    Add dll file path (address) to "System Variables". In Windows search text field (bottom left of the screen) type envir > hit Enter . "System Properties" wizard is thrown.
    • Select the "Advanced" tab from the top bar > click Environment Variables... . "Environment Variables" wizard is thrown.
    • Double click the "Path" (or "PATH") Variable in the "System Variables" section. "Edit environement variable" wizard is thrown.
    • Copy C:\GL\GLEWbin\bin\Release\Win32 > click New > Paste.
    • Click OK in all 3 wizards.
    • Close Visual Studio > in thrown wizard "Save changes to the following items?" click Save .
    • Restart your PC > open Visual Studio. In "Open recent" list, click "GLFWx32-GLEWx32-GLM-0.sln", the first one. Now your project is open ready for test.
  3. Advertisement
Part 5
Part 5 of 19:

Testing and Correcting Project GLFWx32-GLEWx32-GLM-0

PDF download Download Article
  1. 1
    Test your project. Right click on following address and select Open Link in New Window tutorial01.cpp . Copy the code and paste in Main.cpp code area > in main menu select x86 > hit Ctrl + F5 or in Visual Studio's main menu click the green triangle with phrase "Local Windows Debugger". Two windows should appear. One black and other blue.
    • If only the black window (the console) appears with message: "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorial.", set up is okay, but function glfwCreateWindow did not work.
  2. 2
    Correct errors if any. Files are missing. Copy GLFWx32-GLEWx32-GLM-0 and paste in File Explorer Address Bar. You should see file you added Main.cpp , and 4 other files added by Visual Studio. If they are missing you missed add file Main.cpp . Go to Part 3, step 2, and add it now.
    • In "Error List" if you see error about
      • file with extension .h
        • Check whether folders GLFWx32, GLEWbin, and GLM exist in C:\GL. If they exist,
        • go to previous Part, step 1, Additional Include Directories and follow instructions.
      • file with extension .lib go to previous Part, step 1, Additional Library Directories , and follow instructions. Also to Additional Dependencies .
    • Thrown wizard about System or file .dll, go to previous Part step 2 and follow instructions.
    • For other errors, if you can not correct them, close Visual Studio > delete project folder GLFWx32-GLEWx32-GLM-0 which lives in C:\GLP > open Visual Studio > repeat set up from Part 3. Good programming.
  3. Advertisement
Part 6
Part 6 of 19:

Creating project with GLFWx32-GLEWx32-GLM-0 Template

PDF download Download Article
  1. Go to Visual Studio main menu and, while GLFWx32-GLEWx32-GLM-0 is open , click Project > Export Template... .
    • On Export template Wizard check Project Template , if it's not checked > click Next > .
    • On "Export Template Wizard" ( Select Template Options ), Template name should be GLFWx32-GLEWx32-GLM-0 > click Finish . The Template has been created. Delete thrown window with template's address.
  2. 2
    Create your project.
    • In Visual Studio main menu click File > New > Project... .
    • In Create a new project wizard, in the list of templates, select GLFWx32-GLEWx32-GLM-0 (if it's not visible, enter its name in the search bar above the list and press Enter ) > click Next .
    • In the Configure your new project wizard, "Project name" should be GLFWx32-GLEWx32-GLM-01 .
    • Location should be C:\GLP .
    • Be sure Place solution and project in the same directory is checked. Click Create , and wait till project be created.
    • In Visual Studio's GUI main menu, select x86 > hit Ctrl + F5 or in Visual Studio's main menu click the green triangle with phrase "Local Windows Debugger".
    • TIP. Remember, when you create project with this template, in Visual Studio GUI main menu select x86 .
  3. Advertisement
Part 7
Part 7 of 19:

Downloading GLFWx64, GLEWbin, and GLM

PDF download Download Article
  1. 1
    Create folders GL and GLP. Open Windows's File Explorer > Navigate to disk (directory) C.
    • If folders GL and GLP exist it's okay.
    • If not, right click in empty area > select New > Folder > type GL > hit Enter . By same way create folder GLP .
  2. 2
    Download GLFW 64 bits. Right click on following address and select Open Link in New Window https://www.glfw.org/download.html .
    • Click 64-bit Windows binaries . You get "glfw-3.4.bin.WIN64.zip" or latest version.
    • Open folder C:\GL.
    • In downloading window click folder "glfw-3.4.bin.WIN64" > click it again and drag into folder C:\GL.
    • Once the folder has completed unzipping, copying, and pasting, copy GLFWx64 > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Close the new "File Explorer" window > close the GLFW window.
  3. 3
    Download GLEWbin. If you don't already have downloaded it, right click on the following link and select Open Link in New Window http://glew.sourceforge.net/ .
    • Below Downloads , find Binaries and click Windows 32-bit and 64-bit .
    • Open folder C:\GL.
    • In downloading window click folder "glew-2.1.0" > click it again and drag into folder C:\GL.
    • Once the folder has completed copying and pasting, copy GLEWbin > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Close the new "File Explorer" window > close the GLEW window.
  4. 4
    Download GLM. If you already have downloaded it it's okay. If not, right click on the following address and select Open Link in New Window https://glm.g-truc.net/0.9.9/index.html .
    • In the upper left corner click Download GLM 0.9.9.7 or latest version (see picture above).
    • Open folder C:\GL.
    • In downloading window click folder "glm" > click it again and drag into folder C:\GL.
    • Once the folder has completed copying and pasting, copy GLM > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Now in folder GL you have folders GLFWx64 GLEWbin GLM
    • Close the new "File Explorer" window > close the GLM window.
  5. Advertisement
Part 8
Part 8 of 19:

Creating Project to target x64 Platform

PDF download Download Article
  1. 1
    Create empty project.
    • If Visual Studio is not open . Open it > click Create a new project .
      • In Create a new project wizard, find Empty Project Start from scratch with C++ for Windows. Provides no starting files. (see image above. If it's not visible, enter its name in the search bar above the list and press Enter ) > click it > click Next .
      • In Configure your new project wizard for "Project name" type (or copy and paste) GLFWx64-GLEWx64-GLM-0
      • Copy C:\GLP and paste in "Location" text field.
      • Check "Place solution and project in the same directory".
      • Click Create .
      • Wait till Visual Studio instance appears.
    • If Visual Studio is open . In main menu click File > New > Project… > the rest as above..
    • In "Solution Explorer" window right click the "Source Files" folder (the last one) > click "Add > "New Item…"
    • In "Add New Item" wizard instead of "FileName" type Main > hit Enter . The source file Main.cpp will open in the main text editor but leave the file blank for now.
  2. Advertisement
Part 9
Part 9 of 19:

Setting up GLFWx64, GLEWx64, and GLM in the Project

PDF download Download Article
  1. Go to "Solution Explorer" > right click on the name of your project GLFWx64-GLEWx64-GLM-0 > select "Properties" (the last one). In "GLFWx64-GLEWx64-GLM-0 Property Pages" wizard,
  2. 2
    Add dll file path (address) to "System Variables". In Windows search text field (bottom left of the screen) type envir > hit Enter . "System Properties" wizard is thrown.
    • Select the "Advanced" tab from the top bar > click Environment Variables... . "Environment Variables" wizard is thrown.
    • Double click the "Path" (or "PATH") Variable in the "System Variables" section. "Edit environement variable" wizard is thrown.
    • Copy C:\GL\GLEWbin\bin\Release\x64 > click New > Paste.
    • Click OK in all 3 wizards.
    • Close Visual Studio > in thrown wizard asking "Save changes to the following items?" click Save .
    • Restart your PC > open Visual Studio. In "Open recent" list, click "GLFWx64-GLEWx64-GLM-0.sln", the first one. Now your project is open ready for test.
    • TIP: Even if in Property Pages main settings it is Platform: x64 , click Configuration manager... , and in Active solution platform: select x64.
  3. Advertisement
Part 10
Part 10 of 19:

Testing and Correcting project GLFWx64-GLEWx64-GLM-0

PDF download Download Article
  1. 1
    Test your project. Right click on following address and select Open Link in New Window tutorial01.cpp . Copy the code and paste in Main.cpp code area > in main menu select x64 > hit Ctrl + F5 or in Visual Studio's main menu click the green triangle with phrase "Local Windows Debugger". Two windows should appear. One black and other blue.
    • If only the black window (the console) appears with message: "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorial.", set up is okay, but function glfwCreateWindow did not work.
  2. 2
    Correct errors if any. Files are missing. Copy GLFWx64-GLEWx64-GLM-0 and paste in File Explorer Address Bar. You should see file you added Main.cpp , and 4 other files added by Visual Studio. If they are missing you missed add file Main.cpp . Go to Part 7, step 5, and add it now.
    • In "Error List" if you see error about
      • file with extension .h
        • Check whether folders GLFWx64, GLEWbin, and GLM exist in C:\GL. If they exist,
        • go to previous Part, step 1, sub step 2. Additional Include Directories and follow instructions.
      • file with extension .lib go to previous Part, step 1, sub step 3. Additional Library Directories , and follow instructions. Also to sub step 4. Additional Dependencies .
    • Thrown wizard about System or file .dll, go to previous Part step 2 and follow instructions.
    • For other errors, if you can not correct them, close Visual Studio > delete project folder GLFWx64-GLEWx64-GLM-0 which lives in C:\GLP > open Visual Studio > repeat set up from Part 7.
  3. Advertisement
Part 11
Part 11 of 19:

Creating Project with GLFWx64-GLEWx64-GLM-0 Template

PDF download Download Article
  1. Go to Visual Studio main menu and, while GLFWx64-GLEWx64-GLM-0 is open , click Project > Export Template... .
    • On Export template Wizard check Project Template , if it's not checked > click Next > .
    • On "Export Template Wizard" ( Select Template Options ), Template name should be GLFWx64-GLEWx64-GLM-0 > click Finish . The Template has been created. Delete thrown window with template's address.
  2. 2
    Create project. Go to Visual Studio main menu and click File > New > Project... .
    • In Create a new project wizard, in the list of templates, select GLFWx64-GLEWx64-GLM-0 (if it's not visible, enter its name in the search bar above the list and press Enter ) > click Next .
    • In the Configure your new project wizard, "Project name" should be GLFWx64-GLEWx64-GLM-01 .
    • Location should be C:\GLP.
    • Be sure Place solution and project in the same directory is checked. Click Create , and wait till project be created.
    • In Visual Studio's GUI main menu, select x64 > hit Ctrl + F5 or in Visual Studio's main menu click the green triangle with phrase "Local Windows Debugger".
    • TIP. When you create project with this template, remember in Visual Studio GUI's main menu select x64 .
  3. Advertisement
Part 12
Part 12 of 19:

Installing CMake

PDF download Download Article
  1. 1
    Compiling a library from the source code guarantees that the resulting library is perfectly tailored for your CPU/OS, a luxury pre-compiled binaries don't always provide. It is also important that binaries you get target x64 platform.
  2. 2
    Create folders GL and GLP. Open Windows's File Explorer > Navigate to disk (directory) C.
    • If folders GL and GLP exist it's okay.
    • If they do not, right click in empty area > select New > Folder > type GL > hit Enter . By same way create folder GLP .
  3. 3
  4. 4
    Copy and unzip the zip folder.
    • Open folder C:\GL.
    • In downloading window click folder "cmake-3.28.3-windows-x86_64" > click it again and drag into folder C:\GL.
    • Once the folder has completed unzipping, copying, and pasting, copy CMake > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Close the new "File Explorer" window > close the "CMake" window.
    • Double click folder "CMake" > double click folder bin > inside you should see CMake's logo next to file name cmake-gui > double click this file. Now on your screen you have CMake GUI > go back to GL folder.
    • Each time you need CMake, navigate to C:\ > GL > double click folder CMake > double click "bin" > double click file cmake-gui (the one with CMake's logo).
  5. Advertisement
Part 13
Part 13 of 19:

Downloading Source GLFW, Source GLEW, and Source GLM

PDF download Download Article
  1. 1
    Download GLFW source. Right-click on following address and select Open Link in New Window https://www.glfw.org/download.html . Select "Source package".
    • Open folder C:\GL
    • Click and drag the "glfw-3.4" (or latest version) folder into C:\GL after it has finished downloading in the new File Explorer window.
    • Once the folder has completed copying and pasting, copy GLFWsrc > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Close the new "File Explorer" window > close the GLFW window.
  2. 2
    Download GLEW source. Right-click on following address and select Open Link in New Window http://glew.sourceforge.net/ . Beside Source click ZIP. Attention avoid the TGZ.
    • Open folder C:\GL.
    • In downloading window click folder "glew-2.1.0" > click it again and drag into folder C:\GL.
    • Once the folder has completed copying and pasting, copy GLEWsrc > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Close the new "File Explorer" window > close the GLEW window.
  3. 3
    Download GLM. If you already have downloaded it it's okay. If not, right click on the following address and select Open Link in New Window https://glm.g-truc.net/0.9.9/index.html .
    • In the upper left corner click Download GLM 0.9.9.7 or latest version (see above picture).
    • Open folder C:\GL.
    • In downloading window click folder "glm" > click it again and drag into folder C:\GL.
    • Once the folder has completed copying and pasting, copy GLM > click folder > right click > click "Rename" (in Windows 11 it is an icon) > Paste > hit Enter .
    • Now in folder GL you have folders GLFWsrc , GLEWsrc , GLM .
    • Close the new "File Explorer" window > close the GLM window.
  4. Advertisement
Part 14
Part 14 of 19:

Building source GLFW, source GLEW, and source GLM

PDF download Download Article
  1. 1
    Build GLFW by CMake and Visual Studio. Go to CMake GUI.
    • Copy ( Be careful do not copy any blank space ) C:/GL/GLFWsrc and paste in first text field.
    • Copy ( Be careful do not copy any blank space ) C:/GL/GLFWsrc/build and paste in second text field ("Where to build the binaries:").
    • Configure and generate. In CMake GUI, click Configure > in wizard Create Directory click Yes > in wizard "Specify the generator for this project" click Finish .
      • When, in CMake GUI, you read: "Configuring done", click Generate . You should read: "Generating done".
        • If, instead, wizard "Error" is thrown, click OK > click "File" > click "Delete Cache" > in thrown wizard "Delete Cache", click Yes .
    • Build your solution.
      • Copy C:\GL\GLFWsrc\build and paste in File Explorer Address Bar > hit Enter > double click "GLFW.sln", or "GLFW", or "ALL_BUILD.vcxproj". An instance of Visual Studio appears. Wait until in main menu Build entry appears. Click it > "Build Solution".
      • Wait till you read the last line in "Output" window: ========== Build: 32 succeeded, 0 failed, 0 up-to-date, 2 skipped" ==========
        • Number of "succeeded" and/or skipped" may changes in glfw versions.
    • Copy C:\GL\GLFWsrc\build\src\Debug and paste in File Explorer Address Bar > hit Enter . Inside you should see file glfw3.lib .
    • Close this instance of Visual Studio.
  2. 2
    Build GLEW by CMake and Visual Studio. Go again to CMake GUI.
    • Copy ( Be careful do not copy any blank space ) C:/GL/GLEWsrc/build/cmake and paste in first text field.
    • Copy ( Be careful do not copy any blank space ) C:/GL/GLEWsrc/build and paste in second text field ("Where to build the binaries:").
    • Configure and generate. In CMake GUI, click Configure > in wizard Create Directory click Yes > in wizard "Specify the generator for this project" click Finish .
      • When, in CMake GUI, you read: "Configuring done", click Generate . You should read: "Generating done".
        • If, instead, wizard "Error" is thrown, click OK > click "File" > click "Delete Cache" > in thrown wizard "Delete Cache", click Yes .
    • Build your solution.
      • Copy C:\GL\GLEWsrc\build and paste in File Explorer Address Bar > hit Enter > double click "glew.sln", or "glew", or "ALL_BUILD.vcxproj". An instance of Visual Studio appears. Wait until in main menu Build entry appears. Click it > "Build Solution".
      • Wait till you read the last line in "Output" window: ========== Build: 6 succeeded, 0 failed, 0 up-to-date, 2 skipped" ==========
        • Number of "succeeded" and/or "skipped" may changes in glew versions.
    • Copy C:\GL\GLEWsrc\build\lib\Debug and paste in File Explorer Address Bar > hit Enter . Inside you should see file glew32d.lib among other files.
    • Close this instance of Visual Studio.
  3. 3
    Build GLM by CMake and Visual Studio. Go once more to CMake GUI.
    • Copy ( Be careful do not copy any blank space ) C:/GL/GLM and paste in first text field.
    • Copy ( Be careful do not copy any blank space ) C:/GL/GLM/build and paste in second text field ("Where to build the binaries:").
    • Configure and generate. In CMake GUI, click Configure > in wizard Create Directory click Yes > in wizard "Specify the generator for this project" click Finish .
      • When, in CMake GUI, you read: "Configuring done", click Generate . You should read: "Generating done".
        • If, instead, wizard "Error" is thrown, click OK > click "File" > click "Delete Cache" > in thrown wizard "Delete Cache", click Yes .
    • Build your solution.
      • Copy C:\GL\GLM\build and paste in File Explorer Address Bar > hit Enter > double click the file "ALL_BUILD.vcxproj" or the file (not the folder) "glm" or "glm.sln". An instance of Visual Studio appears. Wait until in main menu Build entry appears. Click it > click "Build Solution".
      • Wait till you read the last line in "Output" window: ========== Build: 165 succeeded, 0 failed, 0 up-to-date, X skipped" ==========
        • Number of "succeeded" and/or "skipped" may changes in GLM versions.
      • If number of succeeded is less than 165, close Visual Studio instance > delete CMake GUI > go to C: > GL > double click "CMake" > double click "bin" > double click file "cmake-gui". New CMake GUI appears. Follow present step.
        • If now you see ========== Build: 0 succeeded, 0 failed, 165 up-to-date, 2 skipped ==========,
        • or, if you see ========== Build: 3 succeeded, 0 failed, 162 up-to-date, 2 skipped ==========, build is done.
    • Copy C:\GL\GLM\build\glm\Debug and paste in File Explorer Address Bar > hit Enter . Inside you should see file glm_static.lib among other files.
    • Close this instance of Visual Studio.
    • Close CMake GUI.
  4. Advertisement
Part 15
Part 15 of 19:

Creating Project GLFWsrc-GLEWsrc-GLMsrc-0

PDF download Download Article
  1. 1
    Create empty project.
    • If Visual Studio is not open . Open it > click Create a new project .
      • In Create a new project wizard, find Empty Project Start from scratch with C++ for Windows. Provides no starting files. (see image above. If it's not visible, enter its name in the search bar above the list and press Enter ) > click it > click Next .
      • In Configure your new project wizard for "Project name" type (or copy and paste) GLFWsrc-GLEWsrc-GLMsrc-0
      • Copy C:\GLP and paste in "Location" text field.
      • Check "Place solution and project in the same directory".
      • Click Create .
      • Wait till Visual Studio instance appears.
    • If Visual Studio is open . In main menu click File > New > Project… > the rest as above.
    • In "Solution Explorer" window right click the "Source Files" folder (the last one) > click "Add > "New Item…"
    • In "Add New Item" wizard delete "FileName" > type Main > hit Enter . The source file Main.cpp will open in the main text editor but leave the file blank for now.
  2. Advertisement
Part 16
Part 16 of 19:

Setting up built GLFW, built GLEW and built GLM

PDF download Download Article
  1. In Solution Explorer wizard, right click Project's name that is GLFWsrc-GLEWsrc-GLMsrc-0 > select Properties (the last one). In GLFWsrc-GLEWsrc-GLMsrc-0 Property Pages wizard, .
  2. 2
    Add dll files paths (addresses) to "System Variables". In Windows search text field (bottom left of the screen) type envir > hit Enter . "System Properties" wizard is thrown.
    • Select the "Advanced" tab from the top bar > click Environment Variables... . "Environment Variables" wizard is thrown.
    • In the "System Variables" section, double click the "Path" (or "PATH") Variable. "Edit environment variable" wizard is thrown.
    • Copy C:\GL\GLM\build\glm\Debug > click New > Paste.
    • Copy C:\GL\GLEWsrc\build\bin\Debug > click New > Paste.
    • Click OK in all 3 wizards.
    • Close Visual Studio > in thrown wizard asking "Save changes to the following items?" click Save .
    • Restart your PC > open Visual Studio. In "Open recent" list, click "C:\GLP\GLFWsrc-GLEWsrc-GLMsrc-0", the first one. Now your project is open ready for test.
  3. Advertisement
Part 17
Part 17 of 19:

Testing and Correcting project GLFWsrc-GLEWsrc-GLMsrc-0

PDF download Download Article
  1. 1
    Test your project. Right click on following address and select Open Link in New Window tutorial01.cpp . Copy the code and paste in Main.cpp code area > in main menu select x64 > hit Ctrl + F5 or in Visual Studio's main menu click the green triangle with phrase "Local Windows Debugger". Two windows should appear. One black and other blue.
    • If only the black window (the console) appears with message: "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorial.", set up is okay, but function glfwCreateWindow did not work.
  2. 2
    Correct errors if any. Files are missing. Copy GLFWsrc-GLEWsrc-GLMsrc-0 and paste in File Explorer Address Bar. You should see file you added Main.cpp , and 4 other files added by Visual Studio. If they are missing you missed add file Main.cpp . Go to Part 14, step 2, and add it now.
    • In "Error List" if you see error about
      • file with extension .h
        • Check whether folders GLFWsrc, GLEWsrc, and GLM exist in C:\GL. If they exist,
        • go to previous Part, step 1, sub step 2. Additional Include Directories and follow instructions.
      • file with extension .lib go to previous Part, step 1, sub step 3. Additional Library Directories , and follow instructions. Also to sub step 4. Additional Dependencies .
    • Thrown wizard about System or file .dll, go to previous Part step 2 and follow instructions.
    • For other errors, if you can not correct them, close Visual Studio > delete project folder GLFWsrc-GLEWsrc-GLMsrc-0 which lives in C:\GLP > open Visual Studio > repeat set up from Part 14. Good job.
  3. Advertisement


Part 18
Part 18 of 19:

Creating Project with GLFWsrc-GLEWsrc-GLMsrc Template

PDF download Download Article
  1. Go to Visual Studio main menu and, while GLFWsrc-GLEWsrc-GLMsrc-0 is open , click Project > Export Template... .
    • On Export template Wizard check Project Template , if it's not checked > click Next > .
    • On "Export Template Wizard" ( Select Template Options ), Template name should be GLFWsrc-GLEWsrc-GLMsrc-0 > click Finish . The Template has been created. Delete thrown window with template's address.
  2. 2
    Create project. Go to Visual Studio main menu and click File > New > Project... .
    • In Create a new project wizard, in the list of templates, select GLFWsrc-GLEWsrc-GLMsrc-0 (if it's not visible, enter its name in the search bar above the list and press Enter ) > click Next .
    • In the Configure your new project wizard, "Project name" should be GLFWsrc-GLEWsrc-GLMsrc-01 .
    • Location should be C:\GLP.
    • Be sure Place solution and project in the same directory is checked. Click Create , and wait till project be created.
    • In Visual Studio GUI's main menu select x64 (next to Debug) > hit Ctrl + F5 or in Visual Studio's main menu click the green triangle with phrase "Local Windows Debugger". Good job
    • TIP: Remember, in every project you create with this template, select x64 (next to Debug) in Visual Studio's GUI.
  3. Advertisement


Part 19
Part 19 of 19:

Choosing Set Up

PDF download Download Article
  1. 1
    In this tutorial you learn 3 was to set GLFW, GLEW and GLM in Project with Visual Studio.
    • Set up binaries x86 (32 bits). It's the easiest. You should start learning set up from here.
    • Set up binaries x64 (64 bits). It targets x64 platform. Choose it only when you have specific reason for doing so.
    • Compile GLFW source, GLEW source, GLM source, and set up them in project. Targets x64 too.The most difficult. The best though.

Expert Q&A

Ask a Question
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      Thanks to all authors for creating a page that has been read 61,993 times.

      Is this article up to date?

      Advertisement