#include <stdio.h>
#include <allegro5/allegro.h>
class DATA {
public :
ALLEGRO_MUTEX *mutex;
ALLEGRO_COND *cond;
float posiX;
float posiY;
bool modi_x;
bool ready;
DATA() :
mutex(al_create_mutes()),
cond(al_create_cond()),
posiX(0);
posiY(0);
modi_X(false),
ready(false){}
-DATA()
{
al_destroy_mutex(mutex);
al_destroy_cond(cond);
}
};
const float FPS =30;
const int SCREEN_H =640;
int main()
{
return 0;
}
the following error appears when i type this in Xcode and the language is c
1) Excepted ';' after top level deflator
2) unknown type name class
why is this happening and should i need to include any header or is there any work around for this
DATA() : mutex(al_create_mutes()), cond(al_create_cond()), posiX(0); posiY(0); modi_X(false), ready(false){}
Look right after posiX(0) and posiY(0) - you used two semicolons instead of commas.
I have changed that and i still get the same error and it shows an error at the starting itself stating UNKNOWN TYPE NAME and EXPECTED SEMICOLON
under which header does the class comes 


You also mis-spelled al_create_mutex as mutes. There are probably other things too. Post the whole code, use code tags. <code>code goes here</code>
this is actually a tutorial from the allegro site itself and
http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Threads
this is the link of the code
It's "~DATA" not "-DATA". What if you just copy and paste the complete tutorial?
Also make sure you created the file as a c++ file, rather than c.
this is actually a tutorial from the allegro site itself and
http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Threads
this is the link of the code
yes, but the tutorial doesn't have those errors...
this is entire code and even after saving it as c++ file i get the same error
can anyone sort this out
I don't get any errors compiling that. Which compiler are you using, what options or command line etc.?
[EDIT]
nevermind
when i type this in Xcode and the language is c
It has to be compiled as C++. I don't know what Xcode is, try g++.
hmm okay will try it from that , but you need to include all the library into the g++ compiler before compiling it right
you need to include all the library into the g++ compiler before compiling it right
Which library? Allegro? You have to link it in somewhere to get an executable, even with C.
ya allegro only and how do i link it and is there any links or guidance for how to link it to get an executable
xcode is for iOS development afaik.