using GLSL

Started by
4 comments, last by me_here_me 17 years, 5 months ago
Hi All, I downloaded GLSL folder to use it with windows XP and visual Studio. I did the following copying: glew32.dll to windows/system32 glew32.lib to VS/..../PlatformSDK/Lib glew32S.lib to VS/..../PlatformSDK/Lib /GL/glew.h to VS/..../PlatformSDK/Include/GL /GL/wglew.h to VS/..../PlatformSDK/Include/GL but i am not able to compile. The following program from a tutorial page does not execute and produces error about a missing exrernel. include <GL/glew.h> #include <GL/glut.h> void main(int argc, char **argv) { glewInit(); glutInit(&argc, argv); if (glewIsSupported("GL_VERSION_2_0")){ printf("Ready for OpenGL 2.0\n"); } else { printf("OpenGL 2.0 not supported\n"); } glutMainLoop(); } Error 1 error LNK2019: unresolved external symbol __imp__glewIsSupported referenced in function _main second.obj Error 2 error LNK2019: unresolved external symbol __imp__glewInit referenced in function _main second.obj what more do i need to do so that I can work on GLSL thanks in advance
Advertisement
Hi,
you must link opengl library (ie glew32.lib) at your application
okay now i have linked the glew32.lib with the project and the program compiles and runs fine.

but the program prints "OpenGL 2.0 not supported".

and when i changed the program to :

#include <GL/glew.h>
#include <GL/glut.h>

void main(int argc, char **argv) {
glutInit(&argc, argv);
glewInit();
if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader)
printf("Ready for GLSL\n");
else {
printf("Not totally ready :( \n");
exit(1);
}

glutMainLoop();
}


it still prints "Not totally ready".

what version of glut or anything do I need.

I downloaded the following glew folder
"glew-1.3.4-win32".



[Edited by - me_here_me on November 15, 2006 7:29:40 AM]
I guess you could just do the following after the include's:
#pragma comment (lib, "glew32.lib")
running visualinfo.exe produced thee following output

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 6600/PCI/SSE2/3DNOW!
OpenGL version string: 2.0.1


?
okay problem solved

a glut context has to be set up before performing this test

its working okay now:)

thanks all

This topic is closed to new replies.

Advertisement