View Full Version : Problems in opengl programming

05-29-2001, 10:17 AM
Hello everybody,
I'm a beginner. I'm planning to use opengl for my research. I'm using Microsoft VC++6.0(OS:Win NT). I have some doubts.

1. Do i have to do any special settings in VC++6.0 for using opengl?
2. What type of application i.e. what type of file i have to open for writing the codes? When we click File->New, which type of flie and project i should select?
3. I typed the sample program from this webpage http://www.dev-gallery.com/programming/opengl/book/b_index.htm
when i compiled the program i got 3 errors.

d:\vs\vc98\include\gl\gl.h(1152) : error C2144: syntax error : missing ';' before type 'void'
d:\vs\vc98\include\gl\gl.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
d:\vs\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found

I tried some programs from other webpages as well. When i compile those programs - result is same 3 errors.

please help me and tell me how to proceed.

Thanks in advance

05-29-2001, 10:45 AM
I haven't seen this question asked for awhile... http://www.opengl.org/discussion_boards/ubb/smile.gif

You have to #include <windows.h> BEFORE you #include <gl/gl.h>. There are definitions in windows.h that are used in gl.h, WINGDIAPI being one of them.

One more thing... you'll probably get linker errors next if you forget to do this. You must include the opengl32.lib library into your project. Go to project settings, the link tab, and then an edit box that is labeled object/library modules. Add opengl32.lib to that list, and glu32.lib as well if you intend to use glu functions. You should do that for both the Release and Debug configurations.

[This message has been edited by Deiussum (edited 05-29-2001).]

Tim Stirling
05-30-2001, 11:35 PM
hehehe, that caught me out last week, got me stuck for about 10 minutes http://www.opengl.org/discussion_boards/ubb/smile.gif