Why is my class not found?

This one has me scratching my head. For some reason my class is not being recognized. The funny thing is, I have another class in this project that is working completely fine, and I built it the exact same way. I’ve checked my code about a hundred times, and I can’t come up with anything. Here’s the header:

#ifndef _BUTTON  
#define _BUTTON  
#include "ofMain.h"  
class Button{  
	Button(int _bx, int _by, int _bw, int _bh);  
	void initButton();  
	void buildButton();  
	int bx, by, bw, bh, balpha;  
	bool buttonDoneBuilding;  

In testApp.h I’m putting

#include "Button.h"  

right under the include of my other class. Then for my variable I’m declaring:

Button *button;  

When I compile (in MSVC08) I get an error saying that I’m missing a ‘;’ before ‘*’, which I take to mean that it doesn’t recognize ‘Button’ as a data type. Am I missing something completely obvious here?

try changing

#ifndef _BUTTON
#define _BUTTON

with some other constant, _BUTTON seems pretty common, perhaps there’s some other file in some library with that guard define that is making your class not being defined.

On OS X it gives the same error. I found a Button() definition in Carbon.framework, so maybe there is such a definition somewhere in an WindowFramework too?
However: Changing the classname to something like ButtonClass worked!


Dang, I thought of that too, but was too lazy to try it. :roll: I also figured nothing would be that generic in the other frameworks. I just changed my class to GUIButton, and everything is working now. Thanks for the help…