Table of Contents
Remember when we made that "Include" folder? That is where we'll put any external code we want to reference in our project. In that folder, create a new folder and call it "glew". Then, go to http://glew.sourceforge.net
You can either download the binaries, or compile them yourself. If you are unsure, just download the binaries (it's easier). Under "Downloads" click on the link next to "Binaries" where it says "Windows 32-bit and 64-bit".
Extract the zip file and open it. Within, open the "include" folder and then open the "GL" folder (inside the "include" folder). There should be 3 .h files here. Copy them all, and put them inside of the "glew" folder you created in your Visual Studio project.
Back in the main glew directory (the extracted zip file), there should be a "lib" folder. Open it. Within that, open the "Release" folder. Open the appropriate folder for your target platform (32-bit or 64-bit) and then copy the "glew32s.lib" file to the "glew" folder you created in your Visual Studio project. Now you have the files, but you must link them.
In Visual Studio, open your project, right click on it in the "Solution Explorer", and select "Properties". At the top left of this window, where it says "Configuration", change it from "Active(Debug)" to "All Configurations". In the menu on the left, choose "ConfigurationProperties->Linker->General". Double click on "Additional Library Directories" and type "Include\glew" and click "Apply".
Back in the menu on the left, choose "Linker->Input". Click on "Additional Dependencies" and edit the text there (be sure not to delete anything) and add "opengl32.lib;glew32s.lib;" at the end of the line, but before the ";%(AdditionalDependencies)". Then click "Apply" and click "OK". (Note: The opengl32.lib is not part of GLEW, but that's actually how you include OpenGL in your program. You would need to add opengl32.lib even if you weren't adding GLEW.)
Now pick your library: GLFW, FreeGLUT, or SFML
In your "Include" folder, create a new folder and call it "glfw". Then, go to http://www.glfw.org/
You can either download the binaries, or compile them yourself. If you are unsure, just download the binaries (it's easier). Go to "Download" (at the top of the web page) and on the Download page under "Windows pre-compiled binaries" download the 32-bit or 64-bit version (whatever your target system is).
Extract the zip file and open it. Within, open the "include" folder and then open the "GLFW" folder (inside the "include" folder). There should be 2 .h files here. Copy them all, and put them inside of the "glfw" folder you created in your Visual Studio project.
Back in the main glfw directory (the extracted zip file), a bunch of folders that start with "lib" and end with something like "vc2010" or "mingw". These refer to your IDE, which in the case of this tutorial is Visual Studio 2013, so open the "lib-vc2013" folder. Copy the "glfw3.lib" file from this folder into your "glfw" folder in your Visual Studio Project. Now you have the files, but you must link them.
In Visual Studio, open your project, right click on it in the "Solution Explorer", and select "Properties". At the top left of this window, where it says "Configuration", change it from "Active(Debug)" to "All Configurations". In the menu on the left, choose "ConfigurationProperties->Linker->General". Click on "Additional Library Directories" and edit the text there (be sure not delete anything already written there, like "Include\glew") and add the following text at the end of the line: ";Include\glfw" (the semi-colon is a separator) and click "Apply".
Back in the menu on the left, choose "Linker->Input". Click on "Additional Dependencies" and edit the text there (be sure not to delete anything) and add "glfw3.lib;" at the end of the line, but before the ";%(AdditionalDependencies)". Then click "Apply" and click "OK".
In your "Include" folder, create a new folder and call it "freeglut". Then, go to http://freeglut.sourceforge.net/index.php#download
Download the latest stable release. Be aware that you will be downloading a .gz file, which is basically a type of .zip file. If you don't have already have software to handle this type of file, download a program called 7-zip to unzip it. Once you do this, you will find a .tar file, and you can unzip this file using 7-zip as well.
Extract the files to a folder and open it. Copy the include and lib folders to your "sfml" directory (in your Visual Studio Project). In here, there should be "freeglut.sln". Open it. Note: If you have Visual Studio 2012, open this solution with VS2012 and compile FreeGLUT with it. Otherwise, use VS2013 and select "OK" to Upgrade Compiler Libraries.
Build the solution in Visual Studio, then close Visual Studio and return to your extracted FreeGLUT folder. Go into lib\x86\Debug and find the freeglut.lib and freeglut.dll files. Copy the .lib file to your "freeglut" folder (in VisualStudio) and copy the .dll file to your Debug folder in the main Visual Studio project directory.
Back in your extracted FreeGLUT folder, go to include\GL. There should be 4 .h files here. Copy them all, and put them inside of the "freeglut" folder you created in your Visual Studio project. Now you have the files, but you must link them.
In Visual Studio, open your project, right click on it in the "Solution Explorer", and select "Properties". At the top left of this window, where it says "Configuration", change it from "Active(Debug)" to "All Configurations". In the menu on the left, choose "ConfigurationProperties->Linker->General". Click on "Additional Library Directories" and edit the text there (be sure not delete anything already written there, like "Include\glew") and add the following text at the end of the line: ";Include\freeglut" (the semi-colon is a separator) and click "Apply".
Back in the menu on the left, choose "Linker->Input". Click on "Additional Dependencies" and edit the text there (be sure not to delete anything) and add "freeglut.lib;" at the end of the line, but before the ";%(AdditionalDependencies)". Then click "Apply" and click "OK".
In your "Include" folder, create a new folder and call it "sfml". Then, go to http://www.sfml-dev.org/download.php
Download the latest stable release, going for Visual C++ 12 (2013) 32-bit or 64-bit versions (whatever your target system is).
Extract the files to a folder and open it. Within, you should see a "lib" folder and an "include" folder. Copy these folders (the folders themselves) to your "sfml" directory in your Visual Studio project. The contents of the bin folder is all of the .dll files you'll need. Since we are dynamically linking this project to sfml, these .dll's will need to go into your executable target directory. This should be called either "Debug" or "Release". This is the same place you would put FreeGLUT's .dll file or any other .dll you wish to include. To learn more about this process, go here: [INSERT LINK HERE]
The .dll files you're going to want are "sfml-system-2.dll" and "sfml-window-2.dll" and you'll place these one's into the "Release" folder. If you're building a Debug version ( you're putting them into the "Debug" folder, grab "sfml-system-d-2.dll" and "sfml-window-d-2.dll" and copy those into the "Debug" folder.
In Visual Studio, open your project, right click on it in the "Solution Explorer", and select "Properties". At the top left of this window, where it says "Configuration", change it from "Active(Debug)" to "All Configurations". In the menu on the left, choose "ConfigurationProperties->C/C++->General". Click on "AdditionalIncludeDirectories" and add the following text: "Include\sfml\include" then click "Apply". Then go to "ConfigurationProperties->Linker->General". Click on "Additional Library Directories" and edit the text there (be sure not delete anything already written there, like "Include\glew") and add the following text at the end of the line: ";Include\sfml\lib" (the semi-colon is a separator) and click "Apply".
Back in the menu on the left, choose "Linker->Input". Click on "Additional Dependencies" and edit the text there (be sure not to delete anything) and add "sfml-system-d.lib;sfml-window-d.lib;" (if you're using the Debug version, if going for the Release version, remove the "-d" from the file name) at the end of the line, but before the ";%(AdditionalDependencies)". Then click "Apply" and click "OK". Note: If you have "All Configurations" still set in the top left, you will be setting this for both Release and Debug, which is probably not what you want so it's recommended that you switch back into your specific target for this setting.