[Vala] [Genie] Problem with creating GtkSwitch widget



Hi all, I have a problem with creating GtkSwitch widget (and I
apologize for repeating themes).

This source code on Genie and Vala below works fine:

/* Genie */
[indent = 4]

init
    var gtk_switch_button = new Gtk.Button ()
    print "The button has been created"

/* Vala */
int main () {
  var gtk_switch_button = new Gtk.Switch ();
  print ("The button has been created\n");
  return 0;
}

But this source code generates errors:

/* Genie */
[indent = 4]

init
    var gtk_switch_button = new Gtk.Button ()
    print "The button has been created"

valac --verbose --debug --save-temps --pkg gtk+-3.0 gtk3switch.gs

/home/dmitriy/source/valagenie/gtk3switch.c: In function ‘_vala_main’:
/home/dmitriy/source/valagenie/gtk3switch.c:22: error: ‘GtkSwitch’
undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:22: error: (Each
undeclared identifier is reported only once
/home/dmitriy/source/valagenie/gtk3switch.c:22: error: for each
function it appears in.)
/home/dmitriy/source/valagenie/gtk3switch.c:22: error: ‘_tmp0_’
undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:23: error:
‘gtk_switch_button’ undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:24: error: expected
expression before ‘)’ token
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)

/* Vala */
int main () {
  var gtk_switch_button = new Gtk.Switch ();
  print ("The button has been created\n");
  return 0;
}

valac --verbose --debug --save-temps --pkg gtk+-3.0 gtk3switch.vala

/home/dmitriy/source/valagenie/gtk3switch.c: In function ‘_vala_main’:
/home/dmitriy/source/valagenie/gtk3switch.c:21: error: ‘GtkSwitch’
undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:21: error: (Each
undeclared identifier is reported only once
/home/dmitriy/source/valagenie/gtk3switch.c:21: error: for each
function it appears in.)
/home/dmitriy/source/valagenie/gtk3switch.c:21: error: ‘_tmp0_’
undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:22: error:
‘gtk_switch_button’ undeclared (first use in this function)
/home/dmitriy/source/valagenie/gtk3switch.c:23: error: expected
expression before ‘)’ token
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)

Vala 0.11.7.1-263a8 and libgtk3.0-dev is installed (Ubuntu 10.10)

Please help me to understand what is this. thanks

-- 
Banzai,
Dmitriy Kovalenko



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