GLEW not installing properly

Started by
4 comments, last by V-man 11 years, 8 months ago
I installed GLEW and put the files where the website told me to do but when I run my project, I get these errors:

1>main.obj : error LNK2001: unresolved external symbol __imp____glewDisableVertexAttribArray
1>main.obj : error LNK2001: unresolved external symbol __imp____glewVertexAttribPointer
1>main.obj : error LNK2001: unresolved external symbol __imp____glewBindBuffer
1>main.obj : error LNK2001: unresolved external symbol __imp____glewEnableVertexAttribArray
1>main.obj : error LNK2019: unresolved external symbol __imp__glewGetErrorString@4 referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol __imp__glewInit@0 referenced in function _main
1>main.obj : error LNK2001: unresolved external symbol __imp____glewBufferData
1>main.obj : error LNK2001: unresolved external symbol __imp____glewGenBuffers

This is where I put my files:

bin/glew32.dll to system 32
lib/glew32.lib to {VC Root}/Lib
include/GL/glew.h to {VC Root}/Include/GL
include/GL/wglew.h to {VC Root}/Include/GL
Advertisement
And did you link the glew32.lib with your project?

Derp

No I put these few lines of code in and it seemed to work however I'm not really sure what they do. Can I link GLEW without them?

[source lang="cpp"]#pragma once

#include <glew.h>
#pragma comment(lib, "glew32.lib")

#pragma comment(lib, "opengl32.lib")[/source]

No I put these few lines of code in and it seemed to work however I'm not really sure what they do. Can I link GLEW without them?

[source lang="cpp"]#pragma once

#include <glew.h>
#pragma comment(lib, "glew32.lib")

#pragma comment(lib, "opengl32.lib")[/source]


It's basically a way of linking a library in code.

To do it from the IDE, you just add them in the additional dependencies field in your project properties.

Learn to make games with my SDL 2 Tutorials

Ah got it. Thanks for the help :)
http://www.opengl.org/wiki/FAQ#Unresolved_External_Symbol
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement