PDA

View Full Version : Total Beginner to OpenGL - Why don't it work?



02-08-2001, 12:53 AM
Hi there,

I'm a total newbie to OpenGL, and I'm using Visual C++. I've downloaded the source for a very simple example program just get to me started, and it hasn't. Basically, any time I try to make a .exe from this file, I get the linker error LNK2001 - unresolved external symbol - for every OpenGL function I try to run - in the form __imp___glBegin@4.
Since this happens even with glBegin, glEnd, glClear, etc. I'm assuming this isn't a simple version error. My lib directory has opengl32.lib, glu32.lib, glaux.lib, I've got the correct header files <gl/gl.h>. I've got the correct .dll cos I downloaded them again just in case, so what the **** is going on?
Thanks for any help you are able to give.

Cheers,

Byron Thomas

02-08-2001, 01:05 AM
Actually, I just sorted it - duh, sorry I'm not a complete beginner to C++ I just never used any non-standard .lib modules in my code before. Please ignore my rubbish.


Originally posted by ByronThomas:
Hi there,

I'm a total newbie to OpenGL, and I'm using Visual C++. I've downloaded the source for a very simple example program just get to me started, and it hasn't. Basically, any time I try to make a .exe from this file, I get the linker error LNK2001 - unresolved external symbol - for every OpenGL function I try to run - in the form __imp___glBegin@4.
Since this happens even with glBegin, glEnd, glClear, etc. I'm assuming this isn't a simple version error. My lib directory has opengl32.lib, glu32.lib, glaux.lib, I've got the correct header files <gl/gl.h>. I've got the correct .dll cos I downloaded them again just in case, so what the **** is going on?
Thanks for any help you are able to give.

Cheers,

Byron Thomas

Hermann
02-08-2001, 01:22 AM
Are you sure, your LIBs are compatibl with your compiler? Just in case, try to import them from the dlls ( syntax in BC++ is <implib newLib fromDll> for example implib "c:\program files\c++\lib\opengl32.lib" "c:\ dir \opengl32.dll", but I guess VC++ has a tool for that)

02-09-2001, 08:34 AM
Hi,
Try this : (I use visual C++ 6.0)
Project > Settings > Link.
In "Object/library module", write somewhere on the line the name of the .lib you call.
For example opengl32.lib, glut.lib ...

It should work !