glew-cmake/doc/install.html

229 lines
9.2 KiB
HTML
Raw Normal View History

<!-- begin header.html -->
<!--
The OpenGL Extension Wrangler Library
Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
Copyright (C) 2002, Lev Povalahev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html/4/loose.dtd">
<!-- &nbsp;<img src="new.png" height="12" alt="NEW!"> -->
<html>
<head>
<title>GLEW: The OpenGL Extension Wrangler Library</title>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<link href="glew.css" type="text/css" rel="stylesheet">
</head>
<body bgcolor="#fff0d0">
<table border="0" width="100%" cellpadding="12" cellspacing="8" style="height:100%">
<tr>
<td bgcolor="#ffffff" align="left" valign="top" width="200">
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
<tr>
<td valign="top">
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
<tr><td align="center"><i>Latest Release: <a href="https://sourceforge.net/projects/glew/files/glew/1.5.8/">1.5.8</a></i></td></tr>
<tr><td align="center"><br></td></tr>
<tr><td align="center"><img src="./glew.png" alt="GLEW Logo" width="97" height="75"></td></tr>
<tr><td align="center"><br></td></tr>
<tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr><td align="center"><a href="index.html">Download</a></td></tr>
<tr><td align="center">Installation</td></tr>
<tr><td align="center"><a href="basic.html">Basic Usage</a></td></tr>
<tr><td align="center"><a href="advanced.html">Advanced Usage</a></td></tr>
<tr><td align="center"><a href="credits.html">Credits & Copyright</a></td></tr>
<tr><td align="center"><a href="log.html">Change Log</a></td></tr>
<tr><td align="center"><a href="http://sourceforge.net/projects/glew/">Project Page</a></td></tr>
<tr><td align="center"><a href="https://sourceforge.net/mail/?group_id=67586">Mailing Lists</a></td></tr>
<tr><td align="center"><a href="http://sourceforge.net/tracker/?group_id=67586">Bug Tracker</a></td></tr>
</table>
<tr><td align="center"><br></tr>
</table>
</td>
</tr>
<tr>
<td valign="bottom">
<table border="0" width="100%" cellpadding="5" cellspacing="0" align="left">
<tr><td align="center"><i>Last Update: 01-31-11</i></td></tr>
<tr><td align="center">
<a href="http://www.opengl.org"> <img src="./ogl_sm.jpg" width="68"
height="35" border="0" alt="OpenGL Logo"></a>
<a href="http://sourceforge.net"> <img
src="http://sourceforge.net/sflogo.php?group_id=67586&amp;type=1"
width="88" height="31" border="0" alt="SourceForge Logo"></a>
</td>
</tr>
<!--- <tr><td align="center"><a
href="http://sourceforge.net/donate/index.php?group_id=67586"><img
src="http://images.sourceforge.net/images/project-support.jpg"
width="88" height="32" border="0" alt="Support This Project"></a></td></tr> -->
</table>
</td>
</tr>
</table>
</td>
<td bgcolor="#ffffff" align="left" valign="top">
<h1>The OpenGL Extension Wrangler Library</h1>
<!-- end header.html -->
<h2>Installation</h2>
<p>
To use the shared library version of GLEW, you need to copy the
headers and libraries into their destination directories. On Windows
this typically boils down to copying:
</p>
<table border="0" cellpadding="0" cellspacing="0" align="center"> <!-- bgcolor="#f0f0f0" -->
<tr><td align="left"><tt>bin/glew32.dll</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td align="left"><tt>%SystemRoot%/system32</tt></td></tr>
<tr><td align="left"><tt>lib/glew32.lib</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td align="left"><tt>{VC Root}/Lib</tt></td></tr>
<tr><td align="left"><tt>include/GL/glew.h</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr>
<tr><td align="left"><tt>include/GL/wglew.h</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr>
</table>
<p>
</p>
<p>
where <tt>{VC Root}</tt> is the Visual C++ root directory, typically
<tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual
Studio 6.0 or <tt>C:/Program Files/Microsoft Visual
Studio .NET 2003/Vc7/PlatformSDK</tt> for Visual Studio .NET.
</p>
<p>
On Unix, typing <tt>make install</tt> will attempt to install GLEW
into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>. You can
customize the installation target via the <tt>GLEW_DEST</tt>
environment variable if you do not have write access to these
directories.
</p>
<h2>Building Your Project with GLEW</h2>
<p>
There are two ways to build your project with GLEW.
</p>
<h3>Including the source files / project file</h3>
<p>
The simpler but less flexible way is to include <tt>glew.h</tt> and
<tt>glew.c</tt> into your project. On Windows, you also need to
define the <tt>GLEW_STATIC</tt> preprocessor token when building a
static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor
token when building a dll. You also need to replace
<tt>&lt;GL/gl.h&gt;</tt> and <tt>&lt;GL/glu.h&gt;</tt> with
<tt>&lt;glew.h&gt;</tt> in your code and set the appropriate include
flag (<tt>-I</tt>) to tell the compiler where to look for it. For
example:
</p>
<p class="pre">
#include &lt;glew.h&gt;<br>
#include &lt;GL/glut.h&gt;<br>
&lt;gl, glu, and glut functionality is available here&gt;<br>
</p>
<p>
Depending on where you put <tt>glew.h</tt> you may also need to change
the include directives in <tt>glew.c</tt>. Note that if you are using
GLEW together with GLUT, you have to include <tt>glew.h</tt> first.
In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not
need to include it separately.
</p>
<p>
On Windows, you also have the option of adding the supplied project
file <tt>glew_static.dsp</tt> to your workspace (solution) and compile
it together with your other projects. In this case you also need to
change the <tt>GLEW_BUILD</tt> preprocessor constant to
<tt>GLEW_STATIC</tt> when building a static library or executable,
otherwise you get build errors.
</p>
<p>
<b>Note that GLEW does not use the C
runtime library, so it does not matter which version (single-threaded,
multi-threaded or multi-threaded DLL) it is linked with (without
debugging information). It is, however, always a good idea to compile all
your projects including GLEW with the same C runtime settings.</b>
</p>
<h3>Using GLEW as a shared library</h3>
<p>
Alternatively, you can use the provided project files / makefile to
build a separate shared library you can link your projects with later.
In this case the best practice is to install <tt>glew.h</tt>,
<tt>glew32.lib</tt>, and <tt>glew32.dll</tt> / <tt>libGLEW.so</tt> to
where the OpenGL equivalents <tt>gl.h</tt>, <tt>opengl32.lib</tt>, and
<tt>opengl32.dll</tt> / <tt>libGL.so</tt> are located. Note that you
need administrative privileges to do this. If you do not have
administrator access and your system administrator will not do it for
you, you can install GLEW into your own lib and include subdirectories
and tell the compiler where to find it. Then you can just replace
<tt>&lt;GL/gl.h&gt;</tt> with <tt>&lt;GL/glew.h&gt;</tt> in your
program:
</p>
<p class="pre">
#include &lt;GL/glew.h&gt;<br>
#include &lt;GL/glut.h&gt;<br>
&lt;gl, glu, and glut functionality is available here&gt;<br>
</p>
<p>
or:
</p>
<p class="pre">
#include &lt;GL/glew.h&gt;<br>
&lt;gl and glu functionality is available here&gt;<br>
</p>
<p>
Remember to link your project with <tt>glew32.lib</tt>,
<tt>glu32.lib</tt>, and <tt>opengl32.lib</tt> on Windows and
<tt>libGLEW.so</tt>, <tt>libGLU.so</tt>, and <tt>libGL.so</tt> on
Unix (<tt>-lGLEW -lGLU -lGL</tt>).
</p>
<p>
It is important to keep in mind that <tt>glew.h</tt> includes neither
<tt>windows.h</tt> nor <tt>gl.h</tt>. Also, GLEW will warn you by
issuing a preprocessor error in case you have included <tt>gl.h</tt>,
<tt>glext.h</tt>, or <tt>glATI.h</tt> before <tt>glew.h</tt>.
</p>
<!-- begin footer.html -->
</td></tr></table></body>
<!-- end footer.html -->