cs 450: computer graphics installing glut and glew spring 2015 dr. michael j. reale
TRANSCRIPT
CS 450: COMPUTER GRAPHICS
INSTALLING GLUT AND GLEWSPRING 2015
DR. MICHAEL J. REALE
INTRODUCTION
• The following slides will explain how to install GLUT and GLEW on:
• Windows
• Unix/Linux
• Mac?
WINDOWS
DOWNLOAD GLUT AND GLEW
• GLUT: Go to http://user.xmission.com/~nate/glut.html
• Download the “bin” version of GLUT 3.7.6: http://user.xmission.com/~nate/glut/glut-3.7.6-bin.zip
• GLEW: Go to http://glew.sourceforge.net/
• Download the “Binaries Windows 32-bit and 64-bit”: https://sourceforge.net/projects/glew/files/glew/1.11.0/glew-1.11.0-win32.zip/download
• Unzip both
INSTALL GLUT
• glut32.dll copy to:
• 32-bit OS --> C:\Windows\System32\glut32.dll
• 64-bit OS --> C:\Windows\SysWOW64\glut32.dll
• glut32.h copy to:
• C:\Program Files (x86)\Microsoft Visual Studio XX\VC\lnclude\GL\glut32.h
• XX = version of Visual Studio
• You may have to create the GL folder
• glut32.lib copy to:
• C:\Program Files (x86)\Microsoft Visual Studio XX\VC\lib\glut32.lib
• C:\Program Files (x86)\Microsoft Visual Studio XX\VC\lib\amd64\glut32.lib
INSTALL GLEW
• Copy the following (NOTE: use the Win32 versions!):
• bin/Release/Win32/glew32.dll C:\Windows\System32\glew32.dll
• bin/Release/Win32/glew32.dll --> C:\Windows\SysWOW64\glew32.dll
• lib/Release/Win32/glew32.lib C:\Program Files (x86)\Microsoft Visual Studio XX\VC\lib\glew32.lib
• include/GL/*.h C:\Program Files (x86)\Microsoft Visual Studio XX\VC\lnclude\GL\*.h
CREATE PROJECT
• In Visual Studio 2013
• New Project
• Visual C++ Win32 Console
• Choose “Application Settings” and check “Empty”
SETTING UP YOUR PROJECT
• Right-click on your project name in the Solution Explorer and go to “Properties”
• Go to “Linker” “Input” “Additional Dependencies”
• Add:
• glew32.lib
• glut32.lib
• glu32.lib
• opengl32.lib
• Note items are separated by semicolons!
UNIX/LINUX
INSTALLING GLUT AND GLEW
• Both GLUT (or freeglut) and GLEW should be available in your respective package managers
• That said, you will want to install both the regular and developer (“devel”) versions of the packages:
• E.g., glut-devel and glew-devel
COMPILING YOUR CODE
• I’m assuming you are using g++ as your compiler
• If you source file is “HelloGL.cpp”, then use the following command:
• g++ HelloGL.cpp -o HelloGL -lglut -lGLEW -lGL -lGLU -std=c++11
• This will create an executable called “HelloGL”
• ./HelloGL
MAC?
MAC INSTRUCTIONS (SORT OF)
• Unfortunately, I do not have a Mac to test installing/compiling/running with GLUT and GLEW on it.
• GLUT: the following links contains instructions for install GLUT on Mac (and Windows and Unix/Linux)
• http://web.eecs.umich.edu/~sugih/courses/eecs487/glut-howto/
• GLEW: It seems you have to compile it from source, or you have to use Homebrew
• http://nacho4d-nacho4d.blogspot.com/2012/04/installing-glew-in-macos-x.html
• If you run into problems (on any of these platforms), let me know.