title: GLEW linking error
body: <p>I'm trying to do the openGLbook.com tutorial.  I get this common error:</p>
  
  <pre><code>    1&gt;------ Build started: Project: OpenGL Startup, Configuration: Debug Win32 ------
  1&gt;Build started 1/25/2013 8:18:16 PM.
  1&gt;InitializeBuildStatus:
  1&gt;  Touching "Debug\OpenGL Startup.unsuccessfulbuild".
  1&gt;ClCompile:
  1&gt;  All outputs are up-to-date.
  1&gt;ManifestResourceCompile:
  1&gt;  All outputs are up-to-date.
  1&gt;main.obj : error LNK2019: unresolved external symbol __imp__glewGetErrorString@4 referenced in function _Initialize
  1&gt;main.obj : error LNK2019: unresolved external symbol __imp__glewInit@0 referenced in function _Initialize
  1&gt;J:\Coding Projects\OpenGL 3.3 Tutorial\OpenGL Startup\Debug\OpenGL Startup.exe : fatal error LNK1120: 2 unresolved externals
  1&gt;
  1&gt;Build FAILED.
  1&gt;
  1&gt;Time Elapsed 00:00:00.07
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>I've downloaded the latest 64-bit binaries for GLEW from glew.sourceforge.net, and copied them into their corresponding locations within C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A. I've also downloaded the latest freeglut files and did the same.</p>
  
  <p>I'm using VS 2010. The following are the settings I've changed (based on other threads and forums):</p>
  
  <p>1) Properties > VC++ Directories........ added the "include" folder that contains glew.h and freeglut.h</p>
  
  <p>2) Properties > Linker > Input > Additional Dependencies..... added glew32.lib, freeglut.lib, glew32mx.lib, glew32mxs.lib, glew32s.lib</p>
  
  <p>I really don't understand why it still isn't linking the libraries properly. I should also note that I'm working from a different drive than the C drive. Could that have an effect even though I'm linking everything to its proper folder in the properties?</p>
  
  <p>edit: forgot to post the actual code, here it is:</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;GL/glew.h&gt;
  #include &lt;GL/freeglut.h&gt;
  #define WINDOW_TITLE_PREFIX "Chapter 1"
  
  int CurrentWidth = 800,
      CurrentHeight = 600,
      WindowHandle = 0;
  
      unsigned FrameCount = 0;
  
  void Initialize(int, char*[]);
  void InitWindow(int, char*[]);
  void ResizeFunction(int, int);
  void RenderFunction(void);
  void TimerFunction(int);
  void IdleFunction(void);
  
  int main(int argc, char* argv[])
  {
      Initialize(argc, argv);
  
      glutMainLoop();
  
      exit(EXIT_SUCCESS);
  }
  
  void Initialize(int argc, char* argv[])
  {
      GLenum GlewInitResult;
  
      InitWindow(argc, argv);
  
      GlewInitResult = glewInit();
  
      if (GLEW_OK != GlewInitResult) {
          fprintf(
              stderr,
              "ERROR: %s\n",
              glewGetErrorString(GlewInitResult)
              );
      }
  
      fprintf(
          stdout,
          "INFO: OpenGL Version: %s\n",
          glGetString(GL_VERSION)
      );
  
      glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
  }
  
  void InitWindow(int argc, char* argv[])
  {
      glutInit(&amp;argc, argv);
  
      glutInitContextVersion(4, 0);
      glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
      glutInitContextProfile(GLUT_CORE_PROFILE);
  
      glutSetOption(
          GLUT_ACTION_ON_WINDOW_CLOSE,
          GLUT_ACTION_GLUTMAINLOOP_RETURNS
      );
  
      glutInitWindowSize(CurrentWidth, CurrentHeight);
  
      glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
  
      WindowHandle = glutCreateWindow(WINDOW_TITLE_PREFIX);
  
      if(WindowHandle &lt; 1) {
          fprintf(
              stderr,
              "ERROR: Could not create a new rendering window.\n"
          );
          exit(EXIT_FAILURE);
      }
  
      glutReshapeFunc(ResizeFunction);
      glutDisplayFunc(RenderFunction);
      glutIdleFunc(IdleFunction);
      glutTimerFunc(0, TimerFunction, 0);
  }
  
  void ResizeFunction(int Width, int Height)
  {
      CurrentWidth = Width;
      CurrentHeight = Height;
      glViewport(0, 0, CurrentWidth, CurrentHeight);
  }
  
  void RenderFunction(void)
  {
      ++FrameCount;
  
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
      glutSwapBuffers();
      glutPostRedisplay();
  }
  
  
  void IdleFunction(void)
  {
      glutPostRedisplay();
  }
  
  void TimerFunction(int Value)
  {
      if (0 != Value) {
          char* TempString = (char*)
              malloc(512 + strlen(WINDOW_TITLE_PREFIX));
  
          sprintf(
              TempString,
              "%s: %d Frames Per Second @ %d x %d",
              WINDOW_TITLE_PREFIX,
              FrameCount * 4,
              CurrentWidth,
              CurrentHeight
          );
  
          glutSetWindowTitle(TempString);
          free(TempString);
      }
  
      FrameCount = 0;
      glutTimerFunc(250, TimerFunction, 1);
  }
  </code></pre>