View Full Version : problems with windows.h

08-21-2004, 08:14 AM
I am a new user to OpenGL.
currently, I installed visual c++ 2005 expressed edition beta in my winxp.

I also put the required gl.h, glu.h, glut.h and all the libs and dlls to the correct directories.

I tried a code, which needs windows.h. Then I copied a source file on line, and put it into VC\include\, the file is got from the below
the problems is that, there are a number of header files included in the windows.h, and I have none...it's kind of impossible to seach every single file and copy them. How to solve this problem?

Thanks for your kind attention!


08-21-2004, 09:17 AM
Originally posted by chaosy:
I installed visual c++ 2005 expressed edition beta Heh. Frankly speaking, I have no idea how vc++ 2005 even looks like. Anyway, I think that thing about include files didn't actually change. When you include a header file,
#include <windows.h>
you don't need to look for all other headers that are included in <windows.h>. Thery are avaible for a compiler in it's INCLUDE directory. If that's the reason your program does not compile, you have to be doing something else wrong. Maybe some source code would help.

See ya' :)

08-21-2004, 09:50 AM
Hi, guys, thanks
I solved the problem by installing a Platform SDK from msdn website instructions. And it gives a bunch of libs and include files.

The new problem is that, I tested one sample code in redbook, Example 1-2 : Simple OpenGL Program Using GLUT: hello.c.

The suprised thing is, I was told there are lots of syntax errors in gl.h file...

The errors are at the batch of commands as below

WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);

Anyone experienced this before? Then I tested a single line's code, #include<GL/gl.h> it gives the same result...
Am I wrong at any stage?

Thanks & Regards

08-21-2004, 10:39 AM
You need to include windows.h before gl.h on Windows.

08-21-2004, 06:20 PM
Originally posted by ZbuffeR:
You need to include windows.h before gl.h on Windows.Works, but kind of overkill. You can get away with sticking the following snippet before the <gl.h> #include.

#if !defined(APIENTRY) &amp;&amp; defined(WIN32)
#define APIENTRY __stdcall

#if !defined(WINGDIAPI)

08-21-2004, 07:35 PM
yar, thanks a lot to MikeC! that problem was solved.
The new one is it asks form ODBC.lib...
why do I need an ODBC.lib?

why do these kind of problem keep happen to me?!

08-21-2004, 08:18 PM
hi, hi, the ODBC.lib problem is solved as well.

but...new one

LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup

what's that again?