c++glew

fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory


I am attempting to statically link GLEW to Visual Studio 2017. I followed a video tutorial exactly, but I still got an error:

fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory

I have no idea what could be causing it. Here are the steps I took to link GLEW:

  1. Put the folder named GLEW into a folder called dependencies in the solution directory
  2. Went to C/C++, General and under "Additional Include Directories," I added $(SolutionDir)Dependencies\GLEW\include, which, when I go to edit, evaluates to the correct path
  3. Went to Linker, General and under "Additional Library Directories," I added $(SolutionDir)Dependencies\GLEW\lib\Release\Win32, which also evaluates to the correct path
  4. Went to Linker, Input and under "Additional Dependencies," I added glew32s.lib
  5. Finally, I went to C/C++, Preprocessor and under "Preprocessor Definitions," I added GLEW_STATIC

I also did this same process with GLFW, and it worked perfectly, so I have no idea what the problem could be. I have checked and doublechecked the paths, so I am fairly certain that they are correct.


Solution

  • Sounds like you're doing

    #include <GL/glew.h>
    

    When you should be doing

    #include <glew.h>
    

    Is glew.h directly in the win32 folder? Or is there a further "GL" folder?