This topic is now archived and is closed to further replies.

strange error on include

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

when i compile the following code header:

#define TEXMANAGER COGLTextureManager::GetInstance()

class COGLTextureManager
  static COGLTextureManager& GetInstance(void) { return *manager; };

	COGLTextureManager( void );
  ~COGLTextureManager( void );
  static COGLTextureManager* manager;

  int           nofTexturesUsed;
  int           nofTexturesMax;


#include "OGLTextureManager.h"
#include "GL/gl.h"
#include "GL/glu.h"
#include <stdio.h>

// These defines are used to tell us about the type of TARGA file it is

#define TGA_RGB			2		// This tells us it's a normal RGB (really BGR) file

#define TGA_A				3		// This tells us it's a ALPHA file

#define TGA_RLE		 10		// This tells us that the targa is Run-Length Encoded (RLE)

COGLTextureManager *COGLTextureManager::manager = 0;


// Public Member Functions



// Private Member Functions


  nofTexturesUsed = 0;
  nofTexturesMax  = 4;

I get this compiler error: c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2144: syntax error : missing ';' before type 'void' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found including windows.h to the header file removes the error, but I have no idea why. could anyone shed some light on this? [edited by - rick_appleton on August 7, 2003 7:20:15 PM]

Share this post

Link to post
Share on other sites
Forgot to mention:

The gl headers require the Windows header to be included. If you are writing the game for Windows, its not a problem. If you are trying to make it cross platform, you will need to use SDL or an equivilent. You could also just do:

#ifdef WINDOWS
#include "Windows.h"

Share this post

Link to post
Share on other sites