problems setting up opengl using microsoft visual studio

Started by
2 comments, last by com_gom 19 years, 3 months ago
Iam using visual studio for my work in opengl but Iam having some problems setting it up.Iam getting linking errors during run time.The code is compiling but on running it gives linking errors.I have inserted opengl32.lib glu32.lib glut32.lib and the corresponding dlls but iam still getting errors. these are the lind of errors I am getting... Linking... as.obj : error LNK2001: unresolved external symbol _glFlush as.obj : error LNK2001: unresolved external symbol _glEnd
Advertisement
i think i know what your problem is...

you have to include windows.h before gl/gl.h etc...

i hope this solves your problem...
Quote:Original post by virtuacasper
i think i know what your problem is...

you have to include windows.h before gl/gl.h etc...

i hope this solves your problem...


I do not thnik that is the problem because he would be getting compiler errors since OpenGL is dependent on windows.h.

Quote:
have inserted opengl32.lib glu32.lib glut32.lib and the corresponding dlls but iam still getting errors.


Do you mean inserted into the project or added them in via project settings? Try adding
#pragma comment(lib,"opengl32.lib")#pragma comment(lib,"glu32.lib")#pragma comment(lib,"glut32.lib")


to your header file and see if that works.
I tried what you guys said but it is still giving the same errors..I was wondering if I have to include some other libs like gl.lib and glu.lib except
for the 3 lib files I have already added.

This topic is closed to new replies.

Advertisement