VC++ 6.0 link errors

Hello,

I’ve been attempting to execute a very simple OpenGL program using VC++ 6.0. I’m getting my code from a book, and from what I know of c++, it seems to be in good order. So… that means that I must be missing something. I checked my includes and lib folders for glut files, and discovered that I didn’t have any. So, I downloaded them from a university website. However, I still get all the original errors. I’ve included GL/glut.h and stdlib.h, at the top of my program. I running WinXP, and I have a GeForce2 graphics card, if it makes a difference. Is there a good website or page to look at that has information on how to set up your machine to be able to execute these programs? I’ll attach the errors below. Thanks! - Nick

opgl.obj : error LNK2001: unresolved external symbol __imp__glFlush@0
opgl.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
opgl.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
opgl.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
opgl.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
opgl.obj : error LNK2001: unresolved external symbol __imp__glClear@4
opgl.obj : error LNK2001: unresolved external symbol __imp__glOrtho@48
opgl.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
opgl.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
opgl.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
opgl.obj : error LNK2001: unresolved external symbol _glutMainLoop@0
opgl.obj : error LNK2001: unresolved external symbol _glutDisplayFunc@4
opgl.obj : error LNK2001: unresolved external symbol _glutCreateWindow@4
opgl.obj : error LNK2001: unresolved external symbol _glutInitWindowPosition@8
opgl.obj : error LNK2001: unresolved external symbol _glutInitWindowSize@8
opgl.obj : error LNK2001: unresolved external symbol _glutInitDisplayMode@4
opgl.obj : error LNK2001: unresolved external symbol _glutInit@8
Debug/OpenLProject.exe : fatal error LNK1120: 17 unresolved externals
Error executing link.exe.

you have included the lib files into your path but not actually included them into your project. go to project->settings and click the link tab. enter the gl libraries with all the other libraries: opengl32.lib glu32.lib glut32.lib

b

Thanks! That did the trick.

I just strated using OpenGL a few days ago, and I’m already running into a problem. VC++ 6.0 doesn’t like compiling the provided <math.h>. It gives me problems with the inlined functions at the end of the header.

Hobbes

[This message has been edited by Hobbes7714 (edited 10-04-2002).]

Okay… hold up… here’s something wierd. I’m continuing through this book on OGL, and one of the examples includes the following line:

gluOrtho2d(0.0, (GLdouble) w, 0.0, (GLdouble) h);

But, now I’m getting this warning and 2 errors:

warning C4013: ‘gluOrtho2d’ undefined; assuming extern returning int
Linking…
lines.obj : error LNK2001: unresolved external symbol _gluOrtho2d
Debug/OpenLProject.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

I’ve already added the libraries to my project. Any suggestions?

Thanks,
Nick

Nevermind… Stupid me forgot the capital D in gluOrtho2D()

Nick

you have to use this gluOrtho2D(…)
D must be capital.

)