[BUG?] Erro while compile this code? [SOLVED]

Hi all!
I’m trying to compile this cod at M2M 1.1 for Q64, but came a error. Like compiler error…
It’s very simples… I just declare a variable at header file, but header file apears to included more then one time, and then it always return a error.

Fallow file: [attachment=0]teste.rar[/attachment]

Anyone can help?

There is a trick in C++ to include header files only once. Google for it. Also it is not a good idea to declare a variable in header. Declare it in a module and if needed declare it as extern in your header like this extern

I presume you’re talking of using an “Include Guard” - which google should, indeed, find.

In this case, it applies equally to ‘C’ and C++

It is fine to just declare a variable in header - what you should avoid is to define the variable in a header!

Correction, define it in a module, ie a .c file; eg,

int my_variable;

Correct.

For more, see: c-faq.com/decl/decldef.html - or any good ‘C’ textbook.

Thanks so much awneil ! :mrgreen: