Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting error LNK1104: cannot open file 'glew32.lib'

Tags:

c++

opengl

glew

I've already read many answers that wanted to solve this issue but none of them work. I don't think I'm missing anything:

  • Visual Studio 2013 Community Edition
  • Target = all configurations, all platforms (active = debug, Win32)
  • C/C++ > General > Additional Include Directories: H:\#DEV\OpenGL\glew-1.12.0\include
  • Linker > General > Additional Library Directories: H:\#DEV\OpenGL\glew-1.12.0\lib
  • Linker > Input > Additional Dependencies: glew32s.lib (I also tried glew32.lib)
  • Path of both files library files (glew32.lib and glew32s.lib): H:\#DEV\OpenGL\glew-1.12.0\lib\Release\Win32.

I have permission to access the file, I didn't specify a dll since I want to use only the static version. I also tried:

#define GLEW_STATIC

before #include and #pragma comment(linker, "/NODEFAULTLIB:libc.lib") to no avail.

like image 447
mireazma Avatar asked Dec 15 '22 16:12

mireazma


1 Answers

Visual Studio doesn't look into the subfolders of the directories you specified in
Additional Library Directories.

That means that you have to add the exact path where the library is stored
(which would be in your case H:\#DEV\OpenGL\glew-1.12.0\lib\Release\Win32).

like image 120
Axalo Avatar answered Dec 28 '22 23:12

Axalo