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
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 295 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]

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

#301 Post by PupMike »

gposil wrote: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...
Glad to hear you got it sorted out. I have the latest Pango 1.24 installed here and it works just fine btw.

Mike

nikobordx
Posts: 84
Joined: Sat 23 May 2009, 09:08
Location: Bordeaux, France

#302 Post by nikobordx »

Hi all,

New version without warning !

Nicolas.
Attachments
texteditor.gs.tar.gz
(4.34 KiB) Downloaded 391 times

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#303 Post by gpnet »

Hi MU

Did you have time to give a try to the example I posted ?

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

#304 Post by MU »

gpnet wrote:Hi MU

Did you have time to give a try to the example I posted ?
Yes.
I do not have the files/folders it needs, like /root/.packages/unleashed.

So everything is empty.
But the program compiles and runs.
I installed ValaIDE 0.4svn as mentioned in a former message, as 0.5 freezes my upup.

Mark
Attachments
upup.jpg
(107.33 KiB) Downloaded 337 times
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#305 Post by gpnet »

this is the code in AppRun from pizzasgood.

Code: Select all

#ensure there's a deadpackages.txt file, and that it has stuff in it
DEADLIST="$HOME/.packages/deadpackages.txt"
if [ ! -e "$DEADLIST" ] || [ "$(cat "$DEADLIST")" = "" ]; then
	cp "$HOME/.packages/packages.txt" "$DEADLIST"
fi
So I don't understand clearly the logic behind that , but as you see it copy the content from packages.txt to deadpackages.txt and than visualize this content.
All this file must stay in $HOME/.packages . isn't it ?

Post Reply