Hi,

According to Vala's documentation, the following line installs a decent development environment for GNOME, which includes Vala development tools.


$ sudo apt-get install anjuta glade devhelp


I installed these packages but get errors when compiling a "Hello, world!" program:


$ valac hello.vala -o hello
hello.vala:14.7-14.10: error: The namespace name `Glib' could not be found
using Glib;
      ^^^^
hello.vala:23.21-23.26: error: The type name `String' could not be found
    static int main(String[] args) {
                    ^^^^^^
Compilation failed: 2 error(s), 0 warning(s)


I checked and the VAPI files that come with Vala are installed in "/usr/share/vala-0.16/vapi", and "glib-2.0.vapi" is there. Also, the Glib development package is installed in my system (libglib2.0-dev).

This is the source file I'm compiling:


using Glib;

public class App : Object {

    public void run () {
        stdout.printf("Hello, world!\n");
    }

    static int main(String[] args) {
        var app = new App();
        app.run();

        return 0;
    }
}


Any Vala programmers here to help me set up the environment?

Thanks.

Reply via email to