# Problem installing glew on Windows 7 64Bit with VS2010

This topic is 2404 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

for hours now I am trying to use glew on Windows 7 with Visual Studio 2010.

That's what I did:
2. added the glew Include-Directory to my project
3. added the glew lib directory to Library Directories of my project
5. copied glew32.dll to Windows/System32

I tried to compile this source code:
 #include <GL\glew.h> #include <cstdlib> int main() { if (GLEW_OK != glewInit()) exit(1); return 0; } 

On my 32Bit system I have no problems, but using Windows 7 64Bit I get the following Linking Errors:
 error LNK2019: unresolved external symbol __imp__glewInit referenced in function _main error LNK1120: 1 unresolved externals 

Any idea what's wrong?

Nokobon

##### Share on other sites

Are you sure you need to put that in added glew32.lib to aditional dependencies.
There should be a section for .lib files.

Are you building a 32 bit project or 64 bit?

##### Share on other sites
Yes, you are right the Linker can't find the .lib file.
But although I gave the library path (where glew32.lib is in), it cannot be found.

That problem appears when using VS2010 64bit and Windows 7 64bit.
On Windows7 32bit with VS2010 32bit it works properly.

Could there be a problem with the glew32.lib file for 64bit systems?

##### Share on other sites
I suppose you can compile glew and target the 64 bit platform and you'll have a 64 bit .lib and .dll

##### Share on other sites
Side note;

5. copied glew32.dll to Windows/System32

While it is fine to do this on your development system you should NEVER do this for a released version.

Placing files in the System32 path isn't the correct way to do it, instead place the dll with your exe file, this will avoid versioning conflicts and the like.

##### Share on other sites
I figured out that it works when using the glew 32 Bit version on my 64 Bit system. So I don't need to compile it by myself.
But why? Does that mean, although I'm using 64 bit Windows and 64 bit visual sudio it does build for bit?

And thanks for the tip regarding the .dll file.
But linking to the .lib file this way I don't really need the .dll, don't I?

##### Share on other sites
By default Visual Studio builds 32bit applications, you have to create a 64bit config in your project for it to work.

Visual Studio is a 32bit program btw, they haven't made a 64bit version yet.

As for the lib/dll question; if you create a 'library' project which only produces a lib file then you won't need a dll.

However if the project is a dll one and produces a lib and dll file then you need to link to the lib file AND supply the dll as the lib is just a stub which is used to link the dll into the application at runtime.