Glew 1.7.0 - unresolved external symbol glewInit()

Hi,

I am woring on window 7(64bit) with Intel graphics 3000.I have installed glew1.7.0.

I have installed as per the directions in glew website.

glew32.dll in system32 folder.

glew32.lib in C:\ProgramFiles\MicrosoftSDKs\Windows\v6.0A\lib
glew.h and wglew.h in C:\ProgramFiles\MicrosoftSDKs\Windows\v6.0A\Include\GL


#include<stdio.h>
#define GLEW_STATIC
#include<gl/glew.h>
void main()
{
  int i;
  i=glewInit();
  
}

I am getting a linker error
unresolved external symbol _glewInit referenced in function _main

How do i solve this?

Did you actually link with the glew32.lib library?

Hi,

I have linked to glew32.lib.Linker->Input->Additional Dependencies ,in additional dependencies i have given the path to the glew32.lib file.

I never tried what you did but I think you’re supposed to provide the MSVC compiler with the search paths in Linker->General->Additional Library Directories and only put “glew32.lib” in Additional Dependencies.

I think your linker is trying to find a file named with the complete path which isn’t going to work.

Hello,

I solved the problem.Actually i had downloaded glew 64 bit version.I downloaded the 32 bit version it worked.
Thankyou very much for your support.

1 Like

I have a similar problem. I use Visual Studio 2010 and I can’t make it link glew statically.

I include glew.h at first position
#include <GL/glew.h>
from the correct folder
and add the according properties:
C/C++ / General / Additional Include Directories
…\GL\glew\include;

C/C++ / General / Preprocessor
GLEW_STATIC

Linker / General / Additional Include Directories
…\GL\glew\lib;

I get a lot of LNK2001 errors:
e.g.
Error 4 error LNK2001: unresolved external symbol ___glewBindBuffer <<path>>\OpenGLTest.obj

Dynamic linking works. When I remove the preprocessor directive and put glew32.dll to the exe folder it works. But I want to link it statically.

I hope anybody can help me.

When I remove the preprocessor directive and put glew32.dll to the exe folder it works.

That shouldn’t be possible. The static version of GLEW (which I assume you built) is not the same library as the import library version of GLEW.

So if this is happening, it is because you’re still linking to the import library, not the static library. It’s a bit confusing since they both have the “.lib” suffix. But they’re different libraries with different symbols in them.

Thank you for the fast response.
Yes, I indeed was using glew32.lib instead of glew32s.lib.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.