|
Error with type BITMAP |
TioTodi
Member #7,846
October 2006
|
Hi everyone, i'm using an class calling SESystem and inside her i declare an variable of BITMAP type. When i try to compile, the compilator show me this errors: 23 D:\Projetos\Cpp\Spectrum Engine\Trunk\SESystem.h expected unqualified-id before numeric constant Somebody knows what's happening with my code? []'s! Following the code:
|
CGamesPlay
Member #2,559
July 2002
|
Looks like you have a #define BITMAP 3 in your code somewhere. It doesn't have to be 3, of course, just any numeric constant. -- Ryan Patterson - <http://cgamesplay.com/> |
GullRaDriel
Member #3,861
September 2003
|
What CGamesPlay plus: That's said: Do not use any name of an allegro function/variables in your code. The library provide you types and functions, no variables you are forced to use ( I know you get it, there are some variables that you are forced to use but they are already created by allegro.h , you commonly just have to use them). Here we are baby. Some advises:
EDIT: BITMAP, SOUND, SCREEN_W, SCREEN_H and some others are Allegro properties. These are accessible only himself or with himself. Be aware that he will try to eat you if you are proud to try it, you are warned. It is a beast men. With some big tooths and all the needed stuff. "Code is like shit - it only smells if it is not yours" |
TioTodi
Member #7,846
October 2006
|
I revised my code and didn't find any types like allegro library! I can't understand the "why" of this error, it's totally normal my code and not exist duplicated variables or macros. ): Thank's for your answers. |
CGamesPlay
Member #2,559
July 2002
|
#include "SEScene.h" #include "SETime.h" #include "SESound.h" Please post the contents of these 3 files and any files that they include. -- Ryan Patterson - <http://cgamesplay.com/> |
GullRaDriel
Member #3,861
September 2003
|
Also: Operating system, compiler version, allegro version. "Code is like shit - it only smells if it is not yours" |
TioTodi
Member #7,846
October 2006
|
Ok! Following the requested codes: SEScene.h
SEScene.cpp
SETime.h
SETime.cpp
SESound.h
SESound.cpp
=) |
CGamesPlay
Member #2,559
July 2002
|
I didn't ask for any of the cpp files, but I did ask for SEGlobals.h and SETypes.h. Still haven't seen any problems. -- Ryan Patterson - <http://cgamesplay.com/> |
TioTodi
Member #7,846
October 2006
|
Well, here:
@GullRaDriel: WinXP + Mingw 3.3.1 + Allegro 4.2.1 []'s! |
CGamesPlay
Member #2,559
July 2002
|
Man am I good. You have it right here: Quote: #define BITMAP 3 That changes the meaning of "BITMAP" everywhere in your code to "3", so your line reads:3 *bmpMouseSpr; // <- ErrorObviously, that's invalid. Solution: change the #define BITMAP. -- Ryan Patterson - <http://cgamesplay.com/> |
TioTodi
Member #7,846
October 2006
|
God... i'm stupid... STUPID!!! -.-"""""""""""""""""" Thank you so much! |
GullRaDriel
Member #3,861
September 2003
|
#define BITMAP 3 What did I have said ? hmmm... Quote: EDIT: BITMAP, SOUND, SCREEN_W, SCREEN_H and some others are Allegro properties. These are accessible only himself or with himself. Be aware that he will try to eat you if you are proud to try it, you are warned. It is a beast men. With some big tooths and all the needed stuff.
#define BITMAP something /* forbidden */
You are too good, CGamesPlay. I will had let him searching a little bit more :p "Code is like shit - it only smells if it is not yours" |
Kauhiz
Member #4,798
July 2004
|
CGamesPlay, where did you get Allegro 5 from? I didn't know it was out yet. --- |
CGamesPlay
Member #2,559
July 2002
|
Duh, it's in SVN -- Ryan Patterson - <http://cgamesplay.com/> |
LennyLen
Member #5,313
December 2004
|
Of course, if Kauhiz had it, he'd know you were going to say that.
|
|