views:

335

answers:

2

Hi

I am writing a basic toon shader in OpenGL. I am using MSVC 2008. I have included the GLEW libraries. I have also set the additional dependencies in linker. But I am getting the following error:

LINK : fatal error LNK1104: cannot open file 'glew32.lib'

Can someone please help me?

+1  A: 

You need to set your linker to look in the correct place for the library. Either you don't have the lib, or your linker can't find it. Open your project properties dialog, go to linker, specify the lib as a dependency and provide the path to the correct lib folder.

Ed Swangren
Try looking to see if you downloaded a 64 bit version when you really needed 32 bit version etc... Check if the linker is actually set to the library root or if you just included the header root directory.
Suroot
@ ED: I have specified the glew32.lib as additional dependency in the linker.@Sur0ot yes I have downloaded 32 bit version.
Madhura
still the same problem
Madhura
Do you have permissions to the file?
Suroot
You added the dependency, but is your linker setup to look i the correct location for it?
Ed Swangren
@ suroot: i again tried doing wat u said and it worked. Now it is not showing that error. Thanks. But now am getting a new error error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl init(void)" (?init@@YAXXZ)
Madhura
@ Ed: yes linker was not looking in the correct location apparently changed it.
Madhura
A: 

you can also drag and drop the glew32.lib (or any other lib file of course) into your visual studio project and i think it will be automagically linked in and the linker will find it (which i think is your problem). anyhow, i prefer setting my search directories by hand.

didito