This guide will help you get over the first challenge of using OpenGL, GLFW, GLEW, and GLM: Installing and setting them up, and creating your first project with GLFW-GLEW-GLM Template in Visual Studio 2022. It will assume your platform is Windows 10 or 11. During Visual Studio installation, check the Desktop development with C++ workload box, also click "Language pack" and check "English" box. It is addressing the beginner. He can set up GLFW-GLEW-GLM in project with Visual Studio by 3 ways: 1st targeting x32 platform, 2nd targeting x64 platform, and 3rd set up GLFW-GLEW-GLM source compiled by CMake and Visual Studio. Visual Studio 2022 is by default x64, however works interchangeably with x34.


Part 1
Part 1 of 19:

Configuring Visual Studio

  1. 1
    Highlight step or sub-step. Highlight step or sub-step you expect to do and then do it. See as example picture above.
  2. 2
    Download Visual Studio 2022. If you have not done so, you can download it from https://www.visualstudio.com/downloads.
  3. Advertisement
Part 2
Part 2 of 19:

Downloading GLFWx32, GLEWbin, and GLM

  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 they do not, right click in empty area > select New > Folder > type GL > hit Enter. By same way create folder GLP.
  2. 2
    Download GLFW. Right click on the following address and select Open Link in New Window https://www.glfw.org/download.html.
    • Click 32-bit Windows binaries. You will get "glfw-3.3.8.bin.WIN32" or the latest version.
    • Click the download folder "glfw-3.3.7.bin.WIN32" > right click > select copy.
    • Navigate to C: > GL > right click > select paste.
    • Click on "glfw-3.3.8.bin.WIN32" > right click > select Rename > type GLFWx32 > hit Enter.
    • Now in "GL" folder, you have folder GLFWx32.
  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.
    • Click the downloaded folder glew-2.1.0 (or latest version) > right click > select Copy.
    • Navigate to C: > GL > right click > select Paste.
    • (Alternatively, open "Files Explorer" window > C: > GL. Go to downloading window > click downloaded folder and drag into C:\GL)
    • Rename glew-2.1.0 to GLEWbin
    • If folder glew-2.1.0-win32 is downloaded, double click it for get glew-2.1.0.
  4. 4
    Download GLM. Right click on the following address and select Open Link in New Window glm OpenGL mathematics library. In the upper left corner click Download GLM 0.9.9.7 or latest version (see picture above).
    • Click downloaded folder "glm" > right click > Copy.
    • Navigate to C:\GL > right click > Paste.
    • (Alternatively, open "Files Explorer" window > C: > GL. Go to downloading window > click downloaded folder and drag into C:\GL)
    • When copying is finished, rename glm to GLM
  5. Advertisement
Part 3
Part 3 of 19:

Creating Project targeting x32 Platform

  1. 1
    Create empty project.
    • If Visual Studio is not open. Open it > click Create a new project > find (see image above, if necessary scroll down the list. Icon is different than in image, it doesn't matter though) Empty Project Start from scratch with C++ for Windows. Provides no starting files., click it > click Next.
      • In Configure your new project wizard, for "Project name", type (or copy and paste): GLFWx32-GLEWx32-GLM-0
      • In "Location" delete everything, copy C:\GLP\ and paste.
      • Check "Place solution and project in the same directory" > click Create.
      • Wait until Visual Studio instance appears.
    • If it is open. Click File > New > Project… > Empty Project > Next. The rest as above.
  2. 2
    Add your Source file to the project.
    • In "Solution Explorer" window right click the "Source Files" folder (the last one) > click "Add > "New Item…"
    • Copy Main > in the "Add New Item" wizard delete "FileName" > paste > click Add. The source file Main.cpp will open in the main text editor but leave the file blank for now.
  3. Advertisement
Part 4
Part 4 of 19:

Setting up GLFWx32, GLEWx32, and GLM in the Project

  1. 1
    Configure "Property Pages". 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

  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. 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 go to previous Part, step 1, Additional Include Directories and follow instructions. Also check whether folders GLFWx32, GLEWbin, and GLM exist in C:\GL.
      • file with extension .lib go to previous Part, step 1, Additional Library Directories, and follow instructions. Also to Additional Dependencies.
      • "entry point must be defined" go to previous Part 3, step 1, System, and follow instructions.
    • Thrown wizard about system or file .dll, go to previous part steps 2 and 3, 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 Template targeting x32 Platform

  1. 1
    Create Template. 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 necessary scroll dow the list of templates) > 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.
    • 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

  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 they do 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.3.8.bin.WIN64" or latest version.
    • Click folder > right click > Copy.
    • Navigate C:\GL > right click > Paste.
    • When copying is finished, rename folder "glfw-3.3.8.bin.WIN64" to GLFWx64
  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.
    • Click the downloaded folder glew-2.1.0 (or latest version) > right click > select Copy.
    • Navigate to C: > GL > right click > select Paste.
    • (Alternatively, open "Files Explorer" window > C: > GL. Go to downloading window > click downloaded folder and drag into C:\GL)
    • Rename glew-2.1.0 to GLEWbin
    • If folder glew-2.1.0-win32 is downloaded, double click it for get glew-2.1.0.
  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 glm OpenGL mathematics library. In the upper left corner click Download GLM 0.9.9.7 or latest version (see picture above).
    • Click downloaded folder "glm" > right click > Copy.
    • Navigate to C:\GL > right click > Paste.
    • (Alternatively, open "Files Explorer" window > C: > GL. Go to downloading window > click downloaded folder and drag into C:\GL)
    • Rename glm to GLM
  5. Advertisement
Part 8
Part 8 of 19:

Creating Project to target x64 Platform

  1. 1
    Create empty project.
    • If Visual Studio is not open. Open it > click Create a new project > find (see image above, if necessary scroll down the list. Icon is different than in image, it doesn't matter though) Empty Project Start from scratch with C++ for Windows. Provides no starting files., click it > click Next.
      • In Configure your new project wizard, for "Project name", type (or copy and paste): GLFWx64-GLEWx64-GLM-0
      • In "Location" delete everything, copy C:\GLP\ and paste.
      • Check "Place solution and project in the same directory" > click Create.
      • Wait until Visual Studio instance appears.
    • If it is open. Click File > New > Project… > Empty Project > Next. The rest as above.
  2. 2
    Add your Source file to the project.
    • In "Solution Explorer" window right click the "Source Files" folder (the last one) > click "Add > "New Item…"
    • Copy Main > in the "Add New Item" wizard delete "FileName" > paste > click Add. The source file Main.cpp will open in the main text editor but leave the file blank for now.
  3. Advertisement
Part 9
Part 9 of 19:

Setting up GLFWx64, GLEWx64, and GLM in the Project

  1. 1
    Configure "Property Pages". 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

  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. 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 go to previous Part, step 1, sub step 2. Additional Include Directories and follow instructions. Also check whether folders GLFWx64, GLEWbin, and GLM exist in C:\GL.
      • 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.
      • "entry point must be defined" go to previous Part, step 1, sub step 5. System, and follow instructions.
    • Thrown wizard about System or file .dll, go to previous Part, step 2 and 3, 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

  1. 1
    Create Template. 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 your project. Go to Visual Studio main menu,
    • Click File > New > Project....
    • In Create a new project wizard, in the list of templates, select GLFWx64-GLEWx64-GLM-0 (if necessary scroll dow the list of templates) > 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.
    • 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

  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
    Download CMake. Right-click on following address and select Open Link in New Window https://cmake.org/download/. Scroll down the page and find "Latest Release (3.26.0)", (or latest). In second "Platform" list, find (see image above) "Windows x64 ZIP" and click the beside entry cmake-3.26.0-windows-x86_64.zip (or latest) > in opening wizard select Save file.
  4. 4
    Copy and unzip the zip folder.
    • If the downloaded folder doesn't contain line with stripes (unzipped folder) click it > right click > Copy.
    • If downloaded folder's icon contains vertical line with stripes (zipped folder), double click it for get unzipped folder, (or alternatively, click folder > right click > in drop-down menu select Extract all).
      • When unzipping (extracting files) is finished, click unzip folder cmake-3.26.0-windows-x86_64.zip (or latest) > right click > Copy.
    • Go to drive (directory) C: > GL > right click > Paste.
    • (Alternatively click folder "cmake-3.26.0-windows-x86_64" and drag into folder "GL").
    • When copying is finished click folder "cmake-3.26.0-windows-x86_64" > right click > select "Rename" > type CMake > hit Enter > double click it > double click folder bin > inside you should see CMake's logo next to file name cmake-gui > double click this file. If wizard "Windows protect your PC" appears, click More information > Run anyway. Now on your screen you have CMake GUI.
    • 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

  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".
    • In downloading window click folder "glfw-3.3.7" (or latest version) > right click > select Copy.
    • In File Explorer navigate to C:\ > GL > right click > select Paste. Click twice on folder's name > delete name > type (or copy and paste) GLFWsrc > hit Enter.
  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, be aware of the TGZ.
    • In downloading window click folder "glew-2.1.0" (or latest) > right click > Copy.
    • Navigate to C:\ > GL. Right click > Paste. When copying is finished, rename to GLEWsrc > hit Enter. Now in folder GL you have folders GLFWsrc and GLEWsrc, perhaps among others.
  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 glm OpenGL mathematics library. In the upper left corner click Download GLM 0.9.9.7 or latest version (see picture above).
    • Click downloaded folder "glm" > right click > Copy.
    • Navigate to C:\GL > right click > Paste.
    • (Alternatively, open "Files Explorer" window > C: > GL. Go to downloading window > click downloaded folder and drag into C:\GL)
    • Rename glm to GLM
  4. Advertisement
Part 14
Part 14 of 19:

Building source GLFW, source GLEW, and source GLM

  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 ========== Build: 3 succeeded, 0 failed, 162 up-to-date, 2 skipped ==========, it's okay.
    • 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

  1. 1
    Create empty project.
    • If Visual Studio is not open. Open it > click Create a new project > find (see image above, if necessary scroll down the list. Icon is different than in image, it doesn't matter though) Empty Project Start from scratch with C++ for Windows. Provides no starting files., click it > click Next.
      • In Configure your new project wizard, for "Project name", type (or copy and paste): GLFWsrc-GLEWsrc-GLMsrc-0
      • In "Location" delete everything, copy C:\GLP\ and paste.
      • Check "Place solution and project in the same directory" > click Create.
      • Wait until Visual Studio instance appears.
    • If it is open. Click File > New > Project… > Empty Project > Next. The rest as above.
  2. 2
    Add your Source file to the project.
    • In "Solution Explorer" window right click the "Source Files" folder (the last one) > click "Add > "New Item…"
    • Copy Main > in the "Add New Item" wizard delete "FileName" > paste > click Add. The source file Main.cpp will open in the main text editor but leave the file blank for now.
  3. Advertisement
Part 16
Part 16 of 19:

Setting up built GLFW, built GLEW and built GLM

  1. 1
    Configure project's Properties. 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

  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. 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 go to previous Part, step 1, sub step 2. Additional Include Directories and follow instructions. Also check whether folders GLFWsrc, GLEWsrc, and GLM exist in C:\GL.
      • 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.
      • "entry point must be defined" go to previous Part, step 1, sub step 5. System, and follow instructions.
    • Thrown wizard about System or file .dll, go to previous Part, step 2 and 3, 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

  1. 1
    Create Template. 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 your project. Go to Visual Studio main menu,
    • Click File > New > Project....
    • In Create a new project wizard, in the list of templates, select GLFWsrc-GLEWsrc-GLMsrc-0 (if necessary scroll dow the list of templates) > 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. 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

  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.

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 13 people, some anonymous, worked to edit and improve it over time. This article has been viewed 42,823 times.
How helpful is this?
Co-authors: 13
Updated: March 21, 2023
Views: 42,823
Advertisement