openglsuperbible / sb7code

Source code and supporting material for the 7th Edition of OpenGL SuperBible
727 stars 251 forks source link

Installation in Windows 10 Visual Studio 2019 #43

Closed JuanjoTorres closed 2 years ago

JuanjoTorres commented 4 years ago

Windows / Microsoft Visual Studio 2019

I leave here the configuration of the installation of Visual Studio 2019 in Windows. Before modifying anything I got an error with the GLFW compiled libraries. The solution (or at least as it has worked for me) was changing the environment and assigning the platform on which the programs will run. I have also fixed the output of the last cmake command where files were not being generated where they should be. This onstallation guide is the same as in the source code, only the essential parts are modified.

Install CMake. Windows binaries are available from http://www.cmake.org/. Ensure that CMake is in your path. Open a command prompt and change to the directory where you've checked out the code.

Build GLFW

If you are going to use the copy of GLFW included in the archive, enter the GLFW directory in extern/glfw-3.0.4, and type:

cmake -G "Visual Studio 16 2019" -A Win32 .

Open the resulting GLFW.sln file in Visual Studio and build both the debug and release configurations.

Copy and rename the resulting glfw3 libraries:

Build the samples

Open a command prompt and change to the build directory in the source archive. Type:

cmake -G "Visual Studio 16 2019" -A Win32 -S .. -B .

Open the resulting superbible7.sln project in Visual Studio.

The examples will build into the bin directory.

I hope it works for you. Good luck!

kylevondra commented 3 years ago

This saved me so much trouble, thank you for this solution!

nadal12 commented 3 years ago

Thank you so much @JuanjoTorres . Thanks to this post I was able to pass my computer graphics subject! I wish you the best.

manuelpagliuca commented 3 years ago

We got an hero right there... thank you so much dude.

I tried building for x64 systems and seems working the command that i used for cmake :

For building the glfw dir cmake -G "Visual Studio 16 2019" -A x64 .

for building the sb7code dir cmake -G "Visual Studio 16 2019" -A x64 -S .. -B .

Have a nice day 👍

zmertens commented 3 years ago

I needed to copy glfw3.dll into the "sb7code-master/bin" directory along with running the commands and building which has already been mentioned.