If Vala works like C (and by necessity it has to) then you can only use constant expressions as the C standard mandates, that is: expressions that evaluate to constants at compile time:
A constant expression can be evaluated during translation rather than runtime, andaccordingly may be used in anyplace that a constant may be. (ISO/IEC 9899:TC3, 6.6)
Additionally, as the error message you get clarifies, you will need an integer constant expression:
An integer constant expression shall have integer type and shall only have operandsthat are integer constants, enumeration constants, character constants, sizeof expressions whose results are integer constants, and floating constants that are the immediate operands of casts. Cast operators in an integer constant expression shall only convert arithmetic types to integer types, except as part of an operand to the sizeof operator. (ibid.)
A const variable can be reassigned, which means it cannot be a constant expression; sizeof (Foo), on the other hand, is a constant expression because the size of Foo is known at compile time and cannot change at run time.
Everything fell into place.
If you declare variables locally then in c there generating static const gint querry_pos = 2;
And its define if outside, #define querry_pos 2
Thats intresting.