Search code examples
c++openglvisual-studio-2015glfwglew

Cannot open source file "GL/glew.h"


I'm getting into OpenGL and Visual Studio, and just got this warning and couldn't find any possible solution. I've added both GLEW and GLFW Libraries to the include directory, and then again in the input section of the Linker menu, in the project's properties. Anyways, Visual Studio seems unable to find any of them.

See these images - they explain it all.

Include Directories:

enter image description here

Linker Input:

enter image description here

The Problem:

enter image description here

GLEW Directory:

enter image description here

GLFW Directory:

enter image description here

All image link together


Solution

  • It's because your include directories should be pointing to where the header files are, not the .lib files.

    Change your include directory to go to where the .h files are located, for me it's C:\...\glew-2.0.0\include\GL

    The directories you currently have in it should instead go into Additional Library Directories located at linker->general in your options