# GLvoid?

This topic is 4484 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I just started reading through the NeHe tutorial, and of course when I finished the code, I got a ton of build errors. I figured the most important ones to solve first are the ones that say GLsizei and GLvoid are undeclared identifiers. Can someone tell me where those are defined? I have gl.h, glu.h, and glaux.h included. I just need to figure out which one is acting screwy. *EDIT* Nevermind, I just found it in gl.h, but now I wonder what the purpose is of even using GLvoid and GLsizei, since GLvoid is just void and GLsizei is just an int. What's the point?

##### Share on other sites
GLvoid is likely for consistency...everything else gets a typedef, why not void? GLsizei looks as though it is meant to be the equivalent of size_t. Mostly just a way of providing extra type information, even if c++ doesn't respect it. GLsizei somefunc() isn't just returning any old integer, it is returning a size of something.

CM

##### Share on other sites
For some reason, Visual Studio is very unhappy about my use of GLvoid and GLsizei.

// ogl.cpp : Defines the entry point for the application.//#include <windows.h>#include <gl\gl.h>#include <gl\glu.h>#include <gl\glaux.h>#include "stdafx.h"#include "ogl.h"#define MAX_LOADSTRING 100// Global Variables:HGLRC					hRC=NULL;HDC					hDC=NULL;		HWND					hWnd=NULL;			HINSTANCE				hInstance;			bool					keys[256];			bool					active = true;bool					fullscreen = true;TCHAR					szTitle[MAX_LOADSTRING];TCHAR					szWindowClass[MAX_LOADSTRING];// Forward declarations of functions included in this code module:ATOM				MyRegisterClass(HINSTANCE hInstance);BOOL				InitInstance(HINSTANCE, int);LRESULT CALLBACK		WndProc(HWND, UINT, WPARAM, LPARAM);LRESULT CALLBACK		About(HWND, UINT, WPARAM, LPARAM);GLvoid				ReSizeGLScene(GLsizei width, GLsizei height);

The last line there where GLsizei and GLvoid are mentioned is where it freaks. I can't figure it out.

##### Share on other sites
Fruny wrote a reply to a post similiar to this here.

Something else

##### Share on other sites
Well, I stuck my own typedef into the code for GLvoid and it worked just fine, so apparently it isn't really including gl.h for some interesting reason.

##### Share on other sites
Quote:
 Original post by SippyCup // ogl.cpp : Defines the entry point for the application.//#include #include #include #include #include "stdafx.h"#include "ogl.h"

Your problem is that the preprocessor removes everything before #include "stdafx.h". #include "stdafx.h" must be before everything (except for comments).