Button.vala #include <gtk/gtk.h> errors:
Posted: Thu 26 Apr 2012, 19:01
Greetings,
I am unable to find a good windows/vala/genie
Forum. So, thought i'd try here:
I am getting two errors, apparently from the #include.
The gtk.h is here:
C:\vala-0.12\Vala\vala-win32\vala-win32\gtk-bin\include\gtk-2.0\gtk
How do i tell valac where gtk.h is?
Pls, where does the #include belong.(see source below)
Thanks...Vernon
C:\vala-0.12\vmVala>valac -o Button Button.vala
Button.vala:2.2-2.9: error: syntax error, invalid preprocessing directive
#include <gtk/gtk.h>
^^^^^^^^
Button.vala:2.10-2.10: error: syntax error, expected identifier
#include <gtk/gtk.h>
^
Compilation failed: 2 error(s), 0 warning(s)
=======================
// C:\vala-0.12\Vala\vala-win32\vala-win32\gtk-bin\include\gtk-2.0\gtk
#include <gtk/gtk.h>
using Gtk;
public void on_button_clicked(Button source)
{
stdout.printf("Button clicked\n");
}
int main(string[] args)
{
Gtk.init(ref args);
var window = new Window();
window.destroy.connect(Gtk.main_quit);
var button = new Button.with_label("Button");
button.clicked.connect(on_button_clicked);
window.add(button);
window.show_all();
Gtk.main();
return 0;
}
I am unable to find a good windows/vala/genie
Forum. So, thought i'd try here:
I am getting two errors, apparently from the #include.
The gtk.h is here:
C:\vala-0.12\Vala\vala-win32\vala-win32\gtk-bin\include\gtk-2.0\gtk
How do i tell valac where gtk.h is?
Pls, where does the #include belong.(see source below)
Thanks...Vernon
C:\vala-0.12\vmVala>valac -o Button Button.vala
Button.vala:2.2-2.9: error: syntax error, invalid preprocessing directive
#include <gtk/gtk.h>
^^^^^^^^
Button.vala:2.10-2.10: error: syntax error, expected identifier
#include <gtk/gtk.h>
^
Compilation failed: 2 error(s), 0 warning(s)
=======================
// C:\vala-0.12\Vala\vala-win32\vala-win32\gtk-bin\include\gtk-2.0\gtk
#include <gtk/gtk.h>
using Gtk;
public void on_button_clicked(Button source)
{
stdout.printf("Button clicked\n");
}
int main(string[] args)
{
Gtk.init(ref args);
var window = new Window();
window.destroy.connect(Gtk.main_quit);
var button = new Button.with_label("Button");
button.clicked.connect(on_button_clicked);
window.add(button);
window.show_all();
Gtk.main();
return 0;
}