1
votes

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. Thank you in advance!

1
I have no idea what could be causing it You don't have the folder that contains the GL folder in any of the folders your compile searches in its include path.drescherjm
$(SolutionDir)Dependencies\GLEW\include Did you verify that this folder exists? Is there a GL folder inside that?drescherjm
It does exist and it does contain a GL folderDelectable Goat
Is there a glew.h file in that folder. The compiler is saying that there is not. Possibly did you edit the wrong configuration? Settings for each configuration (Debug, Release ...) are independentdrescherjm
yes, there is a glew.h file in that folder. And also yes, I have edited it for all configurations.Delectable Goat

1 Answers

0
votes

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?