Re: [Vala] Newbie questions



On Fri, Feb 29, 2008 at 8:25 PM, coulamac <aigiskos yahoo com> wrote:
Hi,

 I'm attempting to learn Vala and am an extreme newbie,
 so please be gentle with me.

 I am using Ubuntu and dowloaded vala using synaptic.
 Then I copied the Basic Sample from live.gnome.org
 page into a text file I called valaSamples.vala.

 First I tried to compile valaSamples.vala with valac
 from a directory of my making in ~/Documents.  I
 received an error saying I should include
 gobject-2.0.pc to my PKG_CONFIG_PATH.  I've been
 trying to echo $PKG_CONFIG_PATH and set it, but I'm
 not having much luck.  Can anyone give me very, very
 detailed basic instructions on how to compile a vala
 hello world in this fashion?

 Second, I decided to place my shiny valaSamples.vala
 in usr/bin/ where valac lives to see if I could outwit
 PKG_CONFIG_PATH.  I succeeded, but I ran into another
 problem.  I got the following error: Segmentation
 Fault (core dumped).  Hmmm... does anyone know how to
 get more detailed information to find out what went
 wrong?

 For the record, here is the text in valaSamples.vala:

 /* Basic Vala Sample Code */
 using GLib;

 public class Sample : Object {
        public Sample () {
        }

        public void run () {
                stdout.printf ("Hello World\n");
        }

        static int main (string[] args) {
                var sample = new Sample ();
                sample.run ();
                return 0;
        }
 }


 Thanks in advance for your patience and help!  I will
 be happy to edit the tutorial in live.gnome.org with
 your insights, if you don't think the information is
 too basic.


It's likely you're forgetting to add the --pkg line:

valac test.vala -o output --pkg glib-2.0

 ~Andrew

 ~~~~~~~~~
 dissertus scribendo latine videri volo.


      ____________________________________________________________________________________
 Be a better friend, newshound, and
 know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

 _______________________________________________
 Vala-list mailing list
 Vala-list gnome org
 http://mail.gnome.org/mailman/listinfo/vala-list




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