Installation problems

I am trying to get OpenGL working on my Win XP Prof machine with Visual C++ 2005 Express Edition.
The lines below:

int _tmain(int argc, _TCHAR* argv[])

glutInit( &argc, argv );

cause a compile error:

error C2664: ‘glutInit’ : cannot convert parameter 2 from ‘_TCHAR *[]’ to ‘char **’

I have followed the tutorial:

and have done everything except get the Microsoft Platform SDK, for which I will have to buy the DVD as my dialup modem (and I) would die of old age before downloading.
Is this missing SDK the cause of the compile error or is it something else (and maybe I can skip getting the Platform SDK)?

I am pretty sure the Platform SDK is mandatory for doing anything useful with VC++.

If download size is a problem, you will probably have better luck trying with Code::Blocks + mingw, much smaller footprint.

try change the main function to:

int main(int argc, char** argv){

sorry this message to bsperlin.

Hi ktamail,
That change worked as far as letting me get through the glutInit() function, but then glutKeyboardFunc causes a run time error:

Unhandled exception at 0x1000bb1e in Universe2010.exe: 0xC0000005: Access violation reading location 0x00000070.

Is there an way around this? If not I will have to try ZbuffeR’s idea or get the DVD.

past the source code what to compile, because this error, from C++ programming error. maybe it’s uninitalized variables.

glutCreateWindows then glutKeyboardFunc
not change the sequence.

for example function calls in main:


the scene and key function need write to work this.

Wild guess… your project is unicode… and glut still use old ascii. Switch your project to use multi-byte chars instead of unicode.

i did’t guess, i change that two lines and i have got same error:

Unhandled exception at 0x10008563 in test.exe: 0xC0000005: Access violation reading location 0x00000070.

I think that, you will not create window, you unable attach to “keyboard” to window, because you haven’t window’s handle.

from glut source:

/* CENTRY */
glutKeyboardFunc(GLUTkeyboardCB keyboardFunc)
keyboardFunc != NULL || __glutCurrentWindow->special != NULL);
__glutCurrentWindow->keyboard = keyboardFunc;

you see window must be created.

I compiled multi-byte and unicode and works fine together.

i got problem when compile opengl project in codeblock.
every time i compile,the glut.h will come out and say there is 3 error in my code.
but i have try the code in other computer and can be compiled.Is it the problem of my laptop or the glut.h library i download has problem.please reply me.thanks.