Original Post
The problem in question is one related to turning a part of my program into an object. I finally got glFont to work with some sloppy quick procedural code, so as usual I'm now making everything neat and nice and putting it in a class. However, a strange problem has arisen. This error: expected init-declarator before ';' token and expected ',' or ';' before '*' token Here's the file that the error is showing up in:
#ifndef GLOBALS__H
#define GLOBALS__H
#include <allegro.h>
#include <alleggl.h>
#include "camera.h"
#include "debug.h"
#include "draw.h"
#include "gamemanager.h"
#include "gfx.h"
#include "logic.h"
#include "mouse.h"
#include "screen.h"
#include "text.h"
#include "glfont2.h"
using namespace glfont;
extern volatile unsigned int timer;
extern objCamera* Camera;
extern objDebug* Debug;
extern objDraw* Draw;
extern objGameManager* GameManager;
extern objGfx* Gfx;
extern objLogic* Logic;
extern objMouse* Mouse;
extern objScreen* Screen;
extern objText* Text;
extern const char* MOUSE_SPRITE;
extern const char* MOUSE_MASK;
extern const char* TITLE_HEADING;
extern const char* TITLE_HEADING_M;
extern const char* TITLE_BACKGROUND;
extern GLuint texHeading;
extern GLuint texHeading_m;
extern GLuint texTitleBackground;
extern GLFont testFont;
extern GLuint texTestFont;
#endif
and here is the header that broke it
#ifndef TEXT__H
#define TEXT__H
#include <allegro.h>
#include <alleggl.h>
#include <string>
#include <utility>
#include "defines.h"
#include "globals.h"
#include "glfont2.h"
using namespace glfont;
class objText
{
private:
public:
objText();
~objText();
void Out(char*, GLFont, float, float, float, int);
};
#endif
Prior to the line #include "text.h" being added into the first file, everything compiled flawlessly. Trying to add the objText header broke it... Somehow. Keep in mind that this worked when I did it procedurally. The extern objText* Text; business was there when it worked. It was the specific act of adding that #include