[Vala] Global "int" variable.. Problems?



Hey all,

I'm getting some strange errors... I'm trying to use a global int to count
something,
but when I try compiling this:

int index;

public int main(string[] args)
{
    stdout.printf("Ran program: %i",index);
    return 0;
}

I get the following errors:
default/main.c:13: error: ‘index’ redeclared as different kind of symbol
default/main.c:14: error: ‘index’ redeclared as different kind of symbol

So I checked the C file, which contains the following:
extern gint index;
gint index = 0;

This is what's throwing the C compiler off... Anybody have a suggestion?
Thanks -Harry


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]