install.html (9843B)
1<!-- begin header.html --> 2<!-- 3The OpenGL Extension Wrangler Library 4Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net> 5Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> 6Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> 7Copyright (C) 2002, Lev Povalahev 8All rights reserved. 9 10Redistribution and use in source and binary forms, with or without 11modification, are permitted provided that the following conditions are met: 12 13* Redistributions of source code must retain the above copyright notice, 14 this list of conditions and the following disclaimer. 15* Redistributions in binary form must reproduce the above copyright notice, 16 this list of conditions and the following disclaimer in the documentation 17 and/or other materials provided with the distribution. 18* The name of the author may be used to endorse or promote products 19 derived from this software without specific prior written permission. 20 21THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31THE POSSIBILITY OF SUCH DAMAGE. 32--> 33<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html/4/loose.dtd"> 34<html> 35<head> 36<title>GLEW: The OpenGL Extension Wrangler Library</title> 37<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 38<link href="glew.css" type="text/css" rel="stylesheet"> 39</head> 40<body bgcolor="#fff0d0"> 41<table border="0" width="100%" cellpadding="12" cellspacing="8" style="height:100%"> 42<tr> 43<td bgcolor="#ffffff" align="left" valign="top" width="200"> 44<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left"> 45<tr> 46<td valign="top"> 47 48<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left"> 49<tr><td align="center"><i>Latest Release: <a href="https://sourceforge.net/projects/glew/files/glew/2.1.0/">2.1.0</a></i></td></tr> 50<tr><td align="center"><br></td></tr> 51<tr><td align="center"><img src="./glew.png" alt="GLEW Logo" width="97" height="75"></td></tr> 52<tr><td align="center"><br></td></tr> 53<tr><td align="center"> 54<table border="0" cellpadding="0" cellspacing="0" align="center"> 55<tr><td align="center"><a href="index.html">Download</a></td></tr> 56<tr><td align="center"><a href="basic.html">Usage</a></td></tr> 57<tr><td align="center"><a href="build.html">Building</a></td></tr> 58<tr><td align="center">Installation</td></tr> 59<tr><td align="center"><a href="advanced.html">Source Generation</a></td></tr> 60<tr><td align="center"><a href="log.html">Change Log</a></td></tr> 61<tr><td align="center"><br></tr> 62<tr><td align="center"><a href="https://github.com/nigels-com/glew">GitHub</a></td></tr> 63<tr><td align="center"><a href="https://github.com/nigels-com/glew/issues">Issues</a></td></tr> 64<tr><td align="center"><a href="https://github.com/nigels-com/glew/pulls">Pull Requests</a></td></tr> 65<tr><td align="center"><a href="https://github.com/nigels-com/glew#authors">Authors</a></td></tr> 66<tr><td align="center"><a href="https://github.com/nigels-com/glew#copyright-and-licensing">Licensing</a></td></tr> 67<tr><td align="center"><br></tr> 68<tr><td align="center"><a href="https://sourceforge.net/projects/glew">SourceForge Page</a></td></tr> 69</table> 70<tr><td align="center"><br></tr> 71</table> 72</td> 73</tr> 74<tr> 75 76<td valign="bottom"> 77<table border="0" width="100%" cellpadding="5" cellspacing="0" align="left"> 78<tr><td align="center"><i>Last Update: 07-31-17</i></td></tr> 79<tr><td align="center"> 80 <a href="http://www.opengl.org"><img src="./ogl_sm.jpg" width="68" height="35" border="0" alt="OpenGL Logo"></a><br/> 81 <a href="https://github.com/nigels-com/glew"><img src="github.png" width="70" height="29" border="0" alt="GitHub Logo"></a><br/> 82 <a href="https://travis-ci.org/nigels-com/glew/builds"><img src="travis.png" width="114" height="25" border="0" alt="Travis Logo"></a><br/> 83 <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=67586&type=1" width="88" height="31" border="0" alt="SourceForge Logo"></a> 84</td> 85</tr> 86</table> 87</td> 88</tr> 89</table> 90</td> 91 92<td bgcolor="#ffffff" align="left" valign="top"> 93 94<h1>The OpenGL Extension Wrangler Library</h1> 95 96<!-- end header.html --> 97 98 99<h2>Installation</h2> 100 101<p> 102To use the shared library version of GLEW, you need to copy the 103headers and libraries into their destination directories. On Windows 104this typically boils down to copying: 105</p> 106 107<table border="0" cellpadding="0" cellspacing="0" align="center"> <!-- bgcolor="#f0f0f0" --> 108<tr><td align="left"><tt>bin/glew32.dll</tt></td><td> to </td> 109<td align="left"><tt>%SystemRoot%/system32</tt></td></tr> 110<tr><td align="left"><tt>lib/glew32.lib</tt></td><td> to </td> 111<td align="left"><tt>{VC Root}/Lib</tt></td></tr> 112<tr><td align="left"><tt>include/GL/glew.h</tt></td><td> to </td> 113<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr> 114<tr><td align="left"><tt>include/GL/wglew.h</tt></td><td> to </td> 115<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr> 116</table> 117<p> 118</p> 119 120<p> 121where <tt>{VC Root}</tt> is the Visual C++ root directory, typically 122<tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual 123Studio 6.0 or <tt>C:/Program Files/Microsoft Visual 124Studio .NET 2003/Vc7/PlatformSDK</tt> for Visual Studio .NET. 125</p> 126 127<p> 128On Unix, typing <tt>make install</tt> will attempt to install GLEW 129into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>. You can 130customize the installation target via the <tt>GLEW_DEST</tt> 131environment variable if you do not have write access to these 132directories. 133</p> 134 135<h2>Building Your Project with GLEW</h2> 136<p> 137There are two ways to build your project with GLEW. 138</p> 139<h3>Including the source files / project file</h3> 140<p> 141The simpler but less flexible way is to include <tt>glew.h</tt> and 142<tt>glew.c</tt> into your project. On Windows, you also need to 143define the <tt>GLEW_STATIC</tt> preprocessor token when building a 144static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor 145token when building a dll. You also need to replace 146<tt><GL/gl.h></tt> and <tt><GL/glu.h></tt> with 147<tt><glew.h></tt> in your code and set the appropriate include 148flag (<tt>-I</tt>) to tell the compiler where to look for it. For 149example: 150</p> 151<p class="pre"> 152#include <glew.h><br> 153#include <GL/glut.h><br> 154<gl, glu, and glut functionality is available here><br> 155</p> 156<p> 157Depending on where you put <tt>glew.h</tt> you may also need to change 158the include directives in <tt>glew.c</tt>. Note that if you are using 159GLEW together with GLUT, you have to include <tt>glew.h</tt> first. 160In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not 161need to include it separately. 162</p> 163<p> 164On Windows, you also have the option of adding the supplied project 165file <tt>glew_static.dsp</tt> to your workspace (solution) and compile 166it together with your other projects. In this case you also need to 167change the <tt>GLEW_BUILD</tt> preprocessor constant to 168<tt>GLEW_STATIC</tt> when building a static library or executable, 169otherwise you get build errors. 170</p> 171<p> 172<b>Note that GLEW does not use the C 173runtime library, so it does not matter which version (single-threaded, 174multi-threaded or multi-threaded DLL) it is linked with (without 175debugging information). It is, however, always a good idea to compile all 176your projects including GLEW with the same C runtime settings.</b> 177</p> 178 179<h3>Using GLEW as a shared library</h3> 180 181<p> 182Alternatively, you can use the provided project files / makefile to 183build a separate shared library you can link your projects with later. 184In this case the best practice is to install <tt>glew.h</tt>, 185<tt>glew32.lib</tt>, and <tt>glew32.dll</tt> / <tt>libGLEW.so</tt> to 186where the OpenGL equivalents <tt>gl.h</tt>, <tt>opengl32.lib</tt>, and 187<tt>opengl32.dll</tt> / <tt>libGL.so</tt> are located. Note that you 188need administrative privileges to do this. If you do not have 189administrator access and your system administrator will not do it for 190you, you can install GLEW into your own lib and include subdirectories 191and tell the compiler where to find it. Then you can just replace 192<tt><GL/gl.h></tt> with <tt><GL/glew.h></tt> in your 193program: 194</p> 195 196<p class="pre"> 197#include <GL/glew.h><br> 198#include <GL/glut.h><br> 199<gl, glu, and glut functionality is available here><br> 200</p> 201 202<p> 203or: 204</p> 205 206<p class="pre"> 207#include <GL/glew.h><br> 208<gl and glu functionality is available here><br> 209</p> 210 211<p> 212Remember to link your project with <tt>glew32.lib</tt>, 213<tt>glu32.lib</tt>, and <tt>opengl32.lib</tt> on Windows and 214<tt>libGLEW.so</tt>, <tt>libGLU.so</tt>, and <tt>libGL.so</tt> on 215Unix (<tt>-lGLEW -lGLU -lGL</tt>). 216</p> 217 218<p> 219It is important to keep in mind that <tt>glew.h</tt> includes neither 220<tt>windows.h</tt> nor <tt>gl.h</tt>. Also, GLEW will warn you by 221issuing a preprocessor error in case you have included <tt>gl.h</tt>, 222<tt>glext.h</tt>, or <tt>glATI.h</tt> before <tt>glew.h</tt>. 223</p> 224 225<!-- begin footer.html --> 226</td></tr></table></body> 227<!-- end footer.html --> 228