Vala and Genie programming

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#281 Post by gpnet »

Yes, I know.

I tried to compile on upup-476 but doesn't work. So I decided to do something in windows waiting for a new alpha release.

EDIT: I forget to say that to choice-unchoise a package you have double click on it. the buttons ADD-REMOVE probably are not useful.

also, I did not try the fixmenu command of course , and I think we also don't need /tmp/PBG_rettags.txt. check it yourself and let me know.

thanks
Giorgio

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#282 Post by gposil »

Any clues as to what is causing this....
# valac --pkg gtk+-2.0 text_viewer.gs
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_checksum_update'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_checksum_get_string'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_checksum_new'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_strcmp0'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `glib_gettext'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_assertion_message_expr'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_checksum_free'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_hash_table_iter_next'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_hash_table_iter_init'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_uri_escape_string'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_set_error_literal'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_warn_message'
collect2: ld returned 1 exit status
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
I've upgraded Glib to 2.18 as has been suggested...still no joy, I can't even get it to work on Ubuntu 9.04...same messages and it has later everything...
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#283 Post by MU »

gposil,

use:
valac --pkg gtk+-2.0 --pkg gtksourceview-2.0 texteditor.gs

which Puppy?
You will need the pet "gtksourceview".
In upup, it is included.

Please look if you have:
/usr/lib/libgtksourceview-2.0.so.0.0.0

If not:
In Puppy 4, it can be installed from:
http://ftp.nluug.nl/ftp/pub/os/Linux/di ... -2.4.2.pet

http://ftp.nluug.nl/ftp/pub/os/Linux/di ... -2.4.2.pet


Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#284 Post by gposil »

Mark,

Puppy is 4.1.2

Yes gtksourceview is installed, it's needed by my other dev packages. Any other clues
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#285 Post by MU »

I updated my message,
please use the blue command to compile.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#286 Post by gposil »

Yes tried that....with only slightly different results
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_checksum_update'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_checksum_get_string'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_checksum_new'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_strcmp0'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `glib_gettext'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgtksourceview-2.0.so: undefined reference to `g_assertion_message_expr'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_checksum_free'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_hash_table_iter_next'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_hash_table_iter_init'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_uri_escape_string'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_set_error_literal'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgtksourceview-2.0.so: undefined reference to `g_assertion_message'
/usr/lib/gcc/i486-t2-linux-gnu/4.2.2/../../../libgio-2.0.so: undefined reference to `g_warn_message'
collect2: ld returned 1 exit status
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)


Very curious
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#287 Post by MU »

If I remember well, I had similar errors.
I then extracted the glib.pet in console (tar -xzvf glib-xxx.pet).
Then copied the files by hand.

I then tried it in a fresh setup of 4.2.0, and here this step was not required.
Maybe thepet does not install correctly, when devx_420.sfs is mounted?

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#288 Post by gposil »

It's a full hdd install, and I checked the versions in the pet against the /usr/lib files...no difference....
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#289 Post by MU »

hm, running out of ideas...

try to type
ldconfig
and reboot?
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#290 Post by gposil »

nope...no change guess i'll have to leave Vala/Genie to others... :(
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#291 Post by MU »

gposil wrote:I've upgraded Glib to 2.18 as has been suggested...still no joy, I can't even get it to work on Ubuntu 9.04...same messages and it has later everything...
Be certain to use 2.20 from this thread:
http://www.murga-linux.com/puppy/viewtopic.php?t=39736
That is the one I tried with success in 4.2.0.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

PupMike
Posts: 18
Joined: Thu 23 Apr 2009, 01:39

#292 Post by PupMike »

It looks like it might be finding an older version of glib. I've attached a small program that will print the current glib version you can use to verify.

Mike
Attachments
GLIBVersion.zip
Run from a terminal to print the glib version
(2.52 KiB) Downloaded 296 times

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#293 Post by gposil »

Ok I got 2.2 from the post you suggested, installed and now I get this
valac --pkg gtk+-2.0 --pkg gtksourceview-2.0 texteditor.gs
texteditor.gs:483.30-483.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:485.9-485.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), nu ll)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
texteditor.gs:494.23-494.68: warning: unhandled error `GLib.Error'
var renamed = file.set_display_name ("samplefile.bak", null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:495.30-495.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:497.9-497.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), nu ll)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
texteditor.gs:498.9-498.28: warning: unhandled error `GLib.Error'
renamed.delete(null)
^^^^^^^^^^^^^^^^^^^^
texteditor.gs:357.35-357.45: error: method `TextFileViewer.on_response' is incom patible with signal `Gtk.Dialog.response', expected `void on_response (Gtk.Dialo g, int)'
search_dialog.response += on_response
^^^^^^^^^^^
texteditor.gs:452.30-452.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:454.9-454.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), nu ll)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
Compilation failed: 1 error(s), 8 warning(s)
# ./getglibversion
GLIB Version = 2.20.0

Not much of an improvement
Last edited by gposil on Wed 03 Jun 2009, 03:33, edited 1 time in total.
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#294 Post by MU »

that is good!

Nicolas did not put file operations in a

Code: Select all

try

except e: IOStreamError
so you get warnings, that is just a hint, to add that. It is not critical.

Just this is:
texteditor.gs:357.35-357.45: error: method `TextFileViewer.on_response' is incom patible with signal `Gtk.Dialog.response', expected `void on_response (Gtk.Dialo g, int)'
search_dialog.response += on_response
I must look after some sleep, what causes this.
There will be a function that needs a different parameter or returnvalue.

You can comment that line for a first test.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#295 Post by gposil »

I had noticed the error nad commented it out but to no avail
# valac --pkg gtk+-2.0 --pkg gtksourceview-2.0 texteditor.gs
texteditor.gs:483.30-483.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:485.9-485.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:494.23-494.68: warning: unhandled error `GLib.Error'
var renamed = file.set_display_name ("samplefile.bak", null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:495.30-495.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:497.9-497.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:498.9-498.28: warning: unhandled error `GLib.Error'
renamed.delete(null)
^^^^^^^^^^^^^^^^^^^^
texteditor.gs:452.30-452.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
texteditor.gs:454.9-454.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation failed: - 8 warning(s)
Compiling still failed. :(
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

PupMike
Posts: 18
Joined: Thu 23 Apr 2009, 01:39

#296 Post by PupMike »

Try changing line 361 to:

Code: Select all

    def private on_response(search_dialog : Gtk.Dialog, response_id : int)

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#297 Post by MU »

Strange, this is what I get in Newyearspup:
# valac --pkg gtk+-2.0 --pkg gtksourceview-2.0 main.gs
main.gs:483.30-483.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
main.gs:485.9-485.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
main.gs:494.23-494.68: warning: unhandled error `GLib.Error'
var renamed = file.set_display_name ("samplefile.bak", null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
main.gs:495.30-495.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
main.gs:497.9-497.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
main.gs:498.9-498.28: warning: unhandled error `GLib.Error'
renamed.delete(null)
^^^^^^^^^^^^^^^^^^^^
main.gs:452.30-452.69: warning: unhandled error `GLib.Error'
var thefile_stream = file.create (FileCreateFlags.NONE, null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
main.gs:454.9-454.83: warning: unhandled error `GLib.Error'
data_stream.put_string (text_view.buffer.get_text(start, end, false), null)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation succeeded - 8 warning(s)
So I get the warnings, but compilation succeeds.
Is the gcc compiler in 4.12 equipped with different settings, so that it refuses to compile with warnings?

Then the code had to be cleaned up like this:
example:

Code: Select all

/*  -- old code --

            text : string 
            len : int 
            FileUtils.get_contents (filename, out text, out len) 
            this.text_view.buffer.set_text (text, len) 
*/

            //-- corrected code --
            try 
                text : string 
                len : int 
                FileUtils.get_contents (filename, out text, out len) 
                this.text_view.buffer.set_text (text, len) 
            except e:Error 
                stdout.printf ("%s\n", e.message)
I don't know, how to set the global compiler options, to be less restrictive.
I can try to reproduce the issues in Puppy 4.12 this evening.
But I already compiled programs with warnings - so I am curious, what is the issue in this case here.

-------------
And PupMike, thanks again :)

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#298 Post by MU »

please also try the "--verbose" option of valac, like:

valac -v --pkg gtk+-2.0 --pkg gtksourceview-2.0 texteditor.gs

This tells me in addition:
cc -o '/root/valide/TextEditor/main' '/root/valide/TextEditor/main.vala.c' -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/glitz -I/usr/include/libpng12 -I/usr/include/gtksourceview-2.0 -I/usr/include/libxml2 -I/usr/X11R7/include -L/usr/X11R7/lib -lgtksourceview-2.0 -lgtk-x11-2.0 -lxml2 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lz -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
Compilation succeeded - 8 warning(s)
Maybe your result gives us important hints.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#299 Post by gposil »

The verbose printout did it...my versions of pango and pangocairo are much later than puppy std so I rolled them back to 2.18 and problem solved....now compiles same as your test...

Thanks for all the help Mark... :) Now I can have a fiddle with this Genie gadget.
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#300 Post by MU »

cool, congratulations 8) :D
Now off for some sleep...

See you again soon ;)
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

Post Reply