Re: [Vala] swpan error won win32

2018-09-27 Thread raum
Hi,

In fact my version of vala makes Win64 binaries so I just put
gspawn-win64-helper-console.exe and all is now perfect.

(in fact I've read something about win32 gspawn when vala was linking my
project so I've thought that I've need gspawn-win32, ooops)

Regards

Raum

> Hi,
>
> I'm trying to launch a command with spawn_async_with_pipes
> unsuccessfully...
>
> I've installed gspawn_console and helper executables in the same directory
> of test.vala
>
> --- test.vala ---
>
> int main (string[] args) {
>
>   string[] spawn_args;
> // spawn_args = { "a_soft.exe" };
>   spawn_args = {"dir"};
>   string[] spawn_env = Environ.get ();
>   Pid child_pid;
>
>   int standard_input;
>   int standard_output;
>   int standard_error;
>
>   try {
>
>   Process.spawn_async_with_pipes (null,
>   spawn_args,
>   spawn_env,
>   SpawnFlags.SEARCH_PATH ,
>   null,
>   out child_pid,
>   out standard_input,
>   out standard_output,
>   out standard_error);
>} catch (SpawnError e) {
>stderr.printf ("Error : %s\n", e.message);
>   }
>
>   return 0;
> }
> --
>
> I've set on a cmd shell : set G_SPAWN_WIN32_DEBUG=1
>
> I've launched valac with a lot ofd debug information about
> vala_gspawn_console:
>>valac test.vala -o test.exe
> calling C:\Vala\bin\vala-gspawn-console.exe with argv:
> argv[0]: C:\Vala\bin\vala-gspawn-console.exe
> argv[1]: 6
> argv[2]: 7
> argv[3]: z
> argv[4]: 4
> argv[5]: -
> argv[6]: -
> argv[7]: y
> argv[8]: y
> argv[9]: w
> argv[10]: pkg-config
> argv[11]: --silence-errors
> argv[12]: --modversion
> argv[13]: glib-2.0
> (...)
>
> and then launched test.exe and get :
>>test.exe
> calling C:\Temp\gspawn-win64-helper-console.exe with argv:
> argv[0]: "C:\Temp\gspawn-win64-helper-console.exe"
> argv[1]: 10
> argv[2]: 11
> argv[3]: 3
> argv[4]: 6
> argv[5]: 8
> argv[6]: -
> argv[7]: y
> argv[8]: y
> argv[9]: -
> argv[10]: dir
> argv[11]: NULL
> Could not load UI: Failed to execute helper program (Invalid argument)
>
> Do you have an idea ? where am I wrong ?
>
> thanks
>
> Regards
>
> Raum
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] swpan error won win32

2018-09-25 Thread raum
Hi,

I'm trying to launch a command with spawn_async_with_pipes unsuccessfully...

I've installed gspawn_console and helper executables in the same directory
of test.vala

--- test.vala ---

int main (string[] args) {

string[] spawn_args;
// spawn_args = { "a_soft.exe" };
spawn_args = {"dir"};
string[] spawn_env = Environ.get ();
Pid child_pid;

int standard_input;
int standard_output;
int standard_error;

try {

Process.spawn_async_with_pipes (null,
spawn_args,
spawn_env,
SpawnFlags.SEARCH_PATH ,
null,
out child_pid,
out standard_input,
out standard_output,
out standard_error);
 } catch (SpawnError e) {
 stderr.printf ("Error : %s\n", e.message);
}

return 0;
}
--

I've set on a cmd shell : set G_SPAWN_WIN32_DEBUG=1

I've launched valac with a lot ofd debug information about
vala_gspawn_console:
>valac test.vala -o test.exe
calling C:\Vala\bin\vala-gspawn-console.exe with argv:
argv[0]: C:\Vala\bin\vala-gspawn-console.exe
argv[1]: 6
argv[2]: 7
argv[3]: z
argv[4]: 4
argv[5]: -
argv[6]: -
argv[7]: y
argv[8]: y
argv[9]: w
argv[10]: pkg-config
argv[11]: --silence-errors
argv[12]: --modversion
argv[13]: glib-2.0
(...)

and then launched test.exe and get :
>test.exe
calling C:\Temp\gspawn-win64-helper-console.exe with argv:
argv[0]: "C:\Temp\gspawn-win64-helper-console.exe"
argv[1]: 10
argv[2]: 11
argv[3]: 3
argv[4]: 6
argv[5]: 8
argv[6]: -
argv[7]: y
argv[8]: y
argv[9]: -
argv[10]: dir
argv[11]: NULL
Could not load UI: Failed to execute helper program (Invalid argument)

Do you have an idea ? where am I wrong ?

thanks

Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] any latest vala binary for windows?

2018-09-21 Thread raum
Hi,

A long time ago I've writed a page 'how to build vala' and I think I will 
update this page

Perhaps you could find indpiration
Http://linbox.free.fr/vala

Regards

RaumLe 21 sept. 2018 7:48 AM, Daniel Brendle  a écrit :
>
> On 9/20/18 2:40 AM, oyster via vala-list wrote:
> > thanks, but this github's build uses installed vala to compile latest
> > source, in other words, there is no pre-built binary. It installs
> > mingw-w64-x86_64-vala-0.38.4-1 first, which happens do not work on my
> > MSYS2(no matter I input `valac`, `valac --help`, `valac test.vala`,
> > there is no message displays;  `valac test.vala` does not produce any
> > C file)
> >
> > Years ago, vala did not work on my MSYS2. Years later, it fails too.
> > Maybe vala loves Linux better. Perhaps this is my last time to try
> > vala before I totally switch to nim for which I can build the latest
> > version without any problem.
> >
> > bye. good luck to vala and me
> > Al Thomas  于2018年9月20日周四 上午8:01写道:
> >>> On Thursday, 20 September 2018, 00:45:51 BST, oyster via vala-list 
> >>>  wrote:
> >>> I give up building from source. So is there any binary vala for
> >>> windows? On MSYS2, there is an old mingw-w64-x86_64-vala-0.38.4-1
> >> It looks like 0.42.0 is there: 
> >> https://github.com/Alexpux/MINGW-packages/pull/4350
> >>
> >> I'm not a Windows user so can't really help further.
> >>
> >> Al
> >>
> >>
> >>
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> > Years ago, vala did not work on my MSYS2. Years later, it fails too.
>
> i have to object, as i built libgtkflow, libhttpseverywhere, effector,
> all of them being projects of mine written in vala, on msys2 for win32
> in 2017 and it worked more or less flawlessly.
>
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] [vala] problem with sorting an array

2018-08-29 Thread raum
Hi all,

I don't understand why I can't sotr my array... :-/ (glib.array)

Could you give me an advice ?

My code below..

Thanks

Raum

-
public class FileAndChunks {
public string filename;
public int64 size;
}

int sort_by_size(FileAndChunks o1, FileAndChunks o2)
{
return  (int) (o1.size > o2.size) - (int) (o1.size < o2.size);
}


public static void main (string[] args) {
Array list = new Array();
FileAndChunks f;

f = new FileAndChunks();
f.size = 8620258;
f.filename = "Sd9YYxjP";
list.append_val(f);
f = new FileAndChunks();
f.size = 6839026;
f.filename = "ybJI6spa";
list.append_val(f);
f = new FileAndChunks();
f.size = 778;
f.filename = "ilWcr20t";
list.append_val(f);
f = new FileAndChunks();
f.size = 0;
f.filename = "ad46NgIK";
list.append_val(f);
f = new FileAndChunks();
f.size = 3513;
f.filename = "dHqrduFS";
list.append_val(f);
f = new FileAndChunks();
f.size = 57109;
f.filename = "Qe0RN69c";
list.append_val(f);
f = new FileAndChunks();
f.size = 4297;
f.filename = "l7CqBp4k";
list.append_val(f);
f = new FileAndChunks();
f.size = 1478;
f.filename = "Mlm3qjai";
list.append_val(f);
f = new FileAndChunks();
f.size = 522;
f.filename = "XiwKxxgX";
list.append_val(f);

print ("BEFORE\n");
for (int i = 0; i < list.length; i++) {
f =  list.index(i);
print ("%s => %d\n", f.filename, (int) f.size);
}

list.sort_with_data(sort_by_size);

print ("\n\nAFTER\n");
for (int i = 0; i < list.length; i++) {
f =  list.index(i);
print ("%s => %d\n", f.filename, (int) f.size);
}
}
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Starting with Vala

2017-04-04 Thread raum
Hello,

I humbly tried to create some programs in Vala but I made a lot of
mistakes (especially on NPC which was my first "big" program that is
really not optimized, clean, etc. but has the merit to try something
complex)

http://www.github.com/Raumy

You could take a look to "check_fs" which is better and my lastest 
"graph_map".

Regards

Raum

> Hello list,
>
> i would like to learn Vala and plan to port a Mono-GNOME-App to Vala. I
> already seen the documentation.
>
> Maybe you know some small Vala apps where i can see the code in action?
>
> Greetings
>
> Sascha
>
> --
> Sascha Manns
> Maifeldstraße 10
> 56727 Mayen
>
> P: +49-2651-4014045
> W: http://saigkill.tuxfamily.org
>
>
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] .me cast resurrection on "Re: The future of Vala"

2017-03-06 Thread raum
Here is the link :
http://prime.fmsoft.net/demo/desktop/mdemo.dll

Could it be possible to have something similar for Vala ?


> Hello à tous,
>
> I admit I do not know webassembly. I prefer to develop "stand alone"
> applications but what you say about it seems very interesting.
>
> I also saw an application capable of running a delphi application on the
> web! It was amazing .. I will try to find the link.
>
> Someone has knowledges about glib and webassembly ?
>
> Regards
>
> Raum
> https://www.github.com/Raumy
>
>
>> Do we really still need a Vala to JS converter? I didn't try, but I
>> think
>> it's possible to compile the whole GLib to WebAssembly with only slight
>> modifications, so Vala can run in browser natively after being built for
>> wasm32 target.
>>
>> Did anyone investigate it?
>>
>> Regards,
>> Dmitry
>>
>> 05.03.2017, 08:06, "Ben Iofel" <iofel...@gmail.com>:
>>> Here is an old Vala to JavaScript compiler
>>>
>>> https://github.com/lethalman/maja
>>>
>>> On Sat, Mar 4, 2017 at 7:34 PM Guillaume Poirier-Morency <
>>> guillaumepoiriermore...@gmail.com> wrote:
>>>
>>>>  It would be quite a challenge in terms of implementation, but I like
>>>>  the idea.
>>>>
>>>>  Maybe having a Web-based compiler for embedding and running snippets
>>>>  would be a good start. It could be integrated in valadoc.org :)
>>>>
>>>>  Le samedi 04 mars 2017 à 15:43 +0100, Dev_NIX a écrit :
>>>>  > I would take a look to WebAssembly. The next few years could be
>>>>  > amazing for the concept of isomorphic web frameworks! (just imagine
>>>>  > Valum running in a web browser as on the server side).
>>>>  >
>>>>  > > Exactly, I thought Vala has good and strong asynchronous
>>>>  > > "mechanics" which made Vala a good choice for webapps. So we
>>>> should
>>>>  > > keep an eye on frameworks which could be the key to success for
>>>>  > > Vala (or at least better recognition). Thanks for informations,
>>>>  > > pending march for the next release ;-) Regards
>>>>  >
>>>>  > ___
>>>>  > vala-list mailing list
>>>>  > vala-list@gnome.org
>>>>  > https://mail.gnome.org/mailman/listinfo/vala-list
>>>>  --
>>>>  Guillaume Poirier-Morency <guillaumepoiriermore...@gmail.com>
>>>>
>>>>  Étudiant au baccalauréat en Informatique à l'Université de Montréal
>>>>  Chercheur boursier à l'IRIC
>>>>
>>>>  Mon blog: https://arteymix.github.io/
>>>>  Clé PGP: B1AD6EA5___
>>>>  vala-list mailing list
>>>>  vala-list@gnome.org
>>>>  https://mail.gnome.org/mailman/listinfo/vala-list
>>>
>>> ___
>>> vala-list mailing list
>>> vala-list@gnome.org
>>> https://mail.gnome.org/mailman/listinfo/vala-list
>> ___
>> vala-list mailing list
>> vala-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/vala-list
>>
>
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to draw on a pixbuf

2016-09-16 Thread raum
Hello,

I think I've found a solution :)
- create a Surface and get the context of this surface
- draw on the surface
- create a pixbuf from the surface
- copy pixbuf into my drawingarea !

SOURCE CODE :

using Gtk;
using Cairo;

public static int main (string[] args) {
Cairo.ImageSurface surface;
Cairo.Context cr;

surface = new Cairo.ImageSurface (Cairo.Format.RGB24, 100, 100);

cr = new Cairo.Context (surface);

cr.paint();
cr.set_source_rgb (1, 1, 1);
cr.rectangle (0, 0, 100, 100);
cr.fill ();

cr.set_source_rgb (1, 0, 0);
cr.rectangle (10, 10, 40, 40);
cr.fill ();
cr.move_to(0, 0);
cr.line_to(100, 100);
cr.stroke();

Gdk.Pixbuf result= Gdk.pixbuf_get_from_surface(
surface, 0, 0, 100, 100);

Gtk.init (ref args);
var window = new Window();
window.title = "First GTK+ Program";
window.border_width = 10;
window.window_position = WindowPosition.CENTER;
window.set_default_size (400, 400);
window.destroy.connect (Gtk.main_quit);

DrawingArea da = new DrawingArea();

window.add(da);

da.draw.connect ((context) => {
Gdk.cairo_set_source_pixbuf (context, result, 0, 0);
context.paint ();
return true;
});

window.show_all ();

Gtk.main ();


return 0;

}


> Hello everyone,
>
> I want to prepare a picture and paste in a drawingarea, so I thought I
> should draw on a pixbuf, then copy it to my drawingarea
>
> I've create a drawing area (500x500) and I've tried this code in "on_draw"
> :
> public bool on_draw(Widget da, Context context) {
> (...)
>   var pixbuf = new Gdk.Pixbuf (Gdk.Colorspace.RGB, false, 8, 100, 100);
> Surface s = Gdk.cairo_surface_create_from_pixbuf (pixbuf, 1,
> null);
> Context c = new Context (s);
> c.move_to(0, 0);
> c.line_to(50, 50);
> c.stroke();
>
> Gdk.cairo_set_source_pixbuf (context, pixbuf, 0, 0);
>
> context.paint ();
> (...)
>
> But the result is a partially black rectangle with some with points
>
> Have you some advices ? :)
>
> Thanks.
>
> Regards
>
> Raum
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to draw on a pixbuf

2016-09-15 Thread raum
Hello everyone,

I want to prepare a picture and paste in a drawingarea, so I thought I
should draw on a pixbuf, then copy it to my drawingarea

I've create a drawing area (500x500) and I've tried this code in "on_draw" :
public bool on_draw(Widget da, Context context) {
(...)
var pixbuf = new Gdk.Pixbuf (Gdk.Colorspace.RGB, false, 8, 100, 100);
Surface s = Gdk.cairo_surface_create_from_pixbuf (pixbuf, 1, null);
Context c = new Context (s);
c.move_to(0, 0);
c.line_to(50, 50);
c.stroke();

Gdk.cairo_set_source_pixbuf (context, pixbuf, 0, 0);

context.paint ();
(...)

But the result is a partially black rectangle with some with points

Have you some advices ? :)

Thanks.

Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to get drag'n drop picture from Firefox ?

2016-08-16 Thread Raum


Hello all,

I've tried to send yesterday a mail but I didnt received a notification,
so please excuse me if you have this message on double... ^_^

I'm trying to get an picture and its URL from Firefox by 'drag & drop'
into my vala application

I only have the URL link "pointed by"  the picture and I think I've missed
something with targets list ... (I've got some hints from
http://faq.pygtk.org/index.py?req=edit=faq23.018.htp)

text/x-moz-url
_NETSCAPE_URL
text/x-moz-url-data
text/x-moz-url-desc
application/x-moz-custom-clipdata
text/_moz_htmlcontext
text/_moz_htmlinfo
text/html
text/unicode
text/plain;charset=utf-8
text/plain
application/x-moz-nativeimage
application/x-moz-file-promise
application/x-moz-file-promise-url
application/x-moz-file-promise-dest-filename

I've took an example from Akshay Shekher
(https://gist.github.com/voldyman/11396492)  and add some lines :

(...)
Gtk.TargetEntry plain_entry = { "text/plain",0, 2 };

target_list += string_entry;
target_list += urilist_entry;
target_list += plain_entry;
(...)

   void on_drag_data_received (Gtk.Widget widget, Gdk.DragContext ctx,
int x, int y,
Gtk.SelectionData selection_data,
uint target_type, uint time) {


(...)

case 2:

string data = (string) selection_data.get_data ();
print ("%s\n", data);
this.add (new Gtk.Label (data));
break;
}

(...)


Do you have some hints to retrieve picture and URL pointed by this picture ?

(example on youtube, if I search "usain bolt", I've got a picture
https://i.ytimg.com/vi/V9sxs9ekWC0/hqdefault.jpg?custom=true=196=110=true=true=90=68=8NoJzcuPtRovVOesoOjRT4iuZGU
and the link to the video https://www.youtube.com/watch?v=V9sxs9ekWC0)

Thanks

Regards

Raum


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to get drag'n drop picture from Firefox ?

2016-08-16 Thread raum
Hello all,

I've tried to send yesterday a mail but I didnt received a notification,
so please excuse me if you have this message on double... ^_^

I'm trying to get an picture and its URL from Firefox by 'drag & drop'
into my vala application

I only have the URL link "pointed by"  the picture and I think I've missed
something with targets list ... (I've got some hints from
http://faq.pygtk.org/index.py?req=edit=faq23.018.htp)

text/x-moz-url
_NETSCAPE_URL
text/x-moz-url-data
text/x-moz-url-desc
application/x-moz-custom-clipdata
text/_moz_htmlcontext
text/_moz_htmlinfo
text/html
text/unicode
text/plain;charset=utf-8
text/plain
application/x-moz-nativeimage
application/x-moz-file-promise
application/x-moz-file-promise-url
application/x-moz-file-promise-dest-filename

I've took an example from Akshay Shekher
(https://gist.github.com/voldyman/11396492)  and add some lines :

(...)
Gtk.TargetEntry plain_entry = { "text/plain",0, 2 };

target_list += string_entry;
target_list += urilist_entry;
target_list += plain_entry;
(...)

   void on_drag_data_received (Gtk.Widget widget, Gdk.DragContext ctx,
int x, int y,
Gtk.SelectionData selection_data,
uint target_type, uint time) {


(...)

case 2:

string data = (string) selection_data.get_data ();
print ("%s\n", data);
this.add (new Gtk.Label (data));
break;
}

(...)


Do you have some hints to retrieve picture and URL pointed by this picture ?

(example on youtube, if I search "usain bolt", I've got a picture
https://i.ytimg.com/vi/V9sxs9ekWC0/hqdefault.jpg?custom=true=196=110=true=true=90=68=8NoJzcuPtRovVOesoOjRT4iuZGU
and the link to the video https://www.youtube.com/watch?v=V9sxs9ekWC0)

Thanks

Regards

Raum


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to get drag'n drop picture from Firefox ?

2016-08-15 Thread Raum

Hello,


I'm trying to get an picutre and its URL from Firefox by 'drag & drop' 
into my vala application


I only have the URL link "pointed by"  the picture and I think I've 
missed something with targets list ... (I've got some hints from 
http://faq.pygtk.org/index.py?req=edit=faq23.018.htp)


text/x-moz-url
_NETSCAPE_URL
text/x-moz-url-data
text/x-moz-url-desc
application/x-moz-custom-clipdata
text/_moz_htmlcontext
text/_moz_htmlinfo
text/html
text/unicode
text/plain;charset=utf-8
text/plain
application/x-moz-nativeimage
application/x-moz-file-promise
application/x-moz-file-promise-url
application/x-moz-file-promise-dest-filename

I've took an example from Akshay Shekher 
(https://gist.github.com/voldyman/11396492)  and add some lines :


(...)
Gtk.TargetEntry plain_entry = { "text/plain",0, 2 };

target_list += string_entry;
target_list += urilist_entry;
target_list += plain_entry;
(...)

   void on_drag_data_received (Gtk.Widget widget, Gdk.DragContext ctx,
int x, int y,
Gtk.SelectionData selection_data,
uint target_type, uint time) {


(...)

case 2:

string data = (string) selection_data.get_data ();
print ("%s\n", data);
this.add (new Gtk.Label (data));
break;
}

(...)


Do you have some hints ? :)

Thanks

Regards

Raum


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Just a news I've read about popularity langage

2016-07-21 Thread raum
Hello,

I've read this news :

http://redmonk.com/sogrady/2016/07/20/language-rankings-6-16/?

And if you look at this picture, you will see that Vala is here :)
http://sogrady-media.redmonk.com/sogrady/files/2016/07/lang.rank_.Q316.plot-WM.png

As I understood, a lot of projects on GitHub and, because Vala is great
(wink) less demand on Stack Overflow ^___^  (well, it's a joke :) But I
think a lot of questions have been asked through this mailing list instead
of StackOverflow)

Just to share my hapiness to see Vala, for once, in a chart and finally in
a good position... ^__^

Regards

Raum
http://github.com/Raumy

ps: soory for duplicate

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Get CREATION DATE OR TIME of file

2016-01-09 Thread raum
Hi,

Problem between windows and linux API,  probably...

Either you can take a look to one of my project wich worked on linux

https://github.com/Raumy/check_fs

Regards
Le 9 janv. 2016 10:30, Chris Daley  a écrit :
>
> Hi all,
>
> One possible solution to this problem that would be Windows only is to
> retrieve the file creation date via the Windows API. The following code is
> untested as I am still setting up my Winodws VM but you might be able to
> try it out in the meantime. You will need to install the Windows SDK if you
> haven't already and I assume you are using mingw. A caveat, I haven't used
> the Windows API in a long time so you may need to double check the headers
> to make sure the function definitions are correct - this is for version
> 7.0. I'm assuming it's possible, as the parts of the Windows API you would
> be linking to are C libraries and this is more or less how you would do it
> in C# but like I said - this is an untested thought experiment that might
> be a total NO-OP. The only thing I could find on the internets was from the
> mailing list quite a few years back -
> http://comments.gmane.org/gmane.comp.programming.vala/2867 - but it does
> suggest that this is entirely possible.
>
> Anyway, the code...
>
> // All of this is Windows API definitions which could be put into a
> separate vapi
>
> // The CreateFile flag for reading
> const int64 GENERIC_READ = 0x8000;
>
> // Contains a 64-bit value representing the number of 100-nanosecond
> intervals since January 1, 1601 (UTC).
> struct FileTime {
>     // The low-order part of the file time.
>     int64 dwLowDateTime;
>     // The high-order part of the file time.
>     int64 dwHighDateTime;
> }
>
> struct SystemTime {
>    int64 wYear;
>    int64 wMonth;
>    int64 wDayOfWeek;
>    int64 wDay;
>    int64 wHour;
>    int64 wMinute;
>    int64 wSecond;
>    int64 wMilliseconds;
> }
>
> [CCode(cheader_filename = "WinBase.h ")]
> public extern bool GetFileTime(void* file_handle,
>     out lpCreationTime,
>     out lpLastAccessTime,
>     out lpLastWriteTime
> );
>
> [CCode(cheader_filename = "WinBase.h ")]
> public extern void CreateFile(
>     string lpFileName,
>     int64 dwDesiredAccess,
>     int64 dwShareMode,
>     void* lpSecurityAttributes,
>     int64 dwCreationDisposition,
>     int64 dwFlagsAndAttributes,
>     void* hTemplateFile
> );
>
> [CCode(cheader_filename = "WinBase.h ")]
> public extern bool FileTimeToSystemTime (FileTime filetime, out SystemTime);
>
> public static int main (string[] args) {
>
>    void* testfile = CreateFile("./test.vala", GENERIC_READ,0, null, 0, 0,
> null);
>    FileTime time;
>    bool success = GetFileTime(testfile,out time, null, null);
>
>     if (success) {
>    SystemTime systime;
>    FileTimeToSystemTime (time, out systime);
>    message ("Success: File created on %02d/%02d/%d %02d:%02d",
> systime.wMonth, systime.wDay, systime.wYear, systime.wHour,
> systime.wMinute);
>     } else {
>   message ("Something went wrong");
>    }
> }
>
> This would need to be compiled with the right paths set to the Windows SDK
> location and linked against Kernel32.lib.
>
> Like I said, it's untested (yet) and I won't have time until next week to
> look at it again, so caveat emptor. If you're wanting to make a nicer
> demonstration out of it, you could save the Windows extern functions and
> struct definitions to a vapi file - like windows.vapi - to make it look
> less complicated (which it is, compared to the C code that would achieve
> the same effect).
>
> Let me know if you have any success.
>
> Cheers
> Chris
>
> 2016-01-08 12:35 GMT-08:00 Edwin De La Cruz :
>
> > Lametablemente no way? At least not directly using Vala , I understand
> > what I have read so far.
> > I keep looking for any option , since it was very important for me to
> > do in Vala and convince some people that language worth learning ...
> > I'll keep looking.
> > Mis proyectos de software libre en:
> > Github - edwinspire
> >
> >
> > 2016-01-08 9:04 GMT-05:00 Luc Chante :
> > > Hi,
> > >
> > > You can test le file a attached to this mail.
> > >
> > > T
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Simple filewalker code. Comments?

2015-08-07 Thread Raum
Hello

My objective was not to monitor un real tome so... No :-)

Regards

Le 6 août 2015 20:33, Al Thomas astav...@yahoo.co.uk a écrit :

  From: Raum r...@no-log.org 
  Sent: Wednesday, 5 August 2015, 8:19 
  Subject: Re: [Vala] Simple filewalker code.  Comments? 
  
  Hello 
  
  I've tried to code something similar 
  https://github.com/Raumy/check_fs 
  
  (It uses md5 hash to check changed files on filesystems) 
  
  You should have a look to check.vala. 


 Thanks for sharing your code. Looks like a useful example 
 of GLib's FileEnumerator. 

 Had you tried GLib's FileMonitor to check for changed files? 
 ( http://valadoc.org/#!api=gio-2.0/GLib.FileMonitor ) 

 Al 
 ___ 
 vala-list mailing list 
 vala-list@gnome.org 
 https://mail.gnome.org/mailman/listinfo/vala-list 
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Simple filewalker code. Comments?

2015-08-05 Thread Raum

Hello

I've tried to code something similar
https://github.com/Raumy/check_fs

(It uses md5 hash to check changed files on filesystems)

I should write a makefile and more comments ^_^ (main class name ils testapp... 
So you should consider this ils not finished :-) )

You should have a look to check.vala.

Regards

Le 28 juil. 2015 12:55, Al Thomas astav...@yahoo.co.uk a écrit :

  From: Charles Hixson charleshixsn@earthl

ink.net   Sent: Tuesday, 28 July 2015, 1:40   Subject: Re: [Vala] Simple 
filewalker code.  Comments? Well, part of what I was looking for was 
stylistic pointers.    The Wiki Vala hacking page has a style guide:  
https://wiki.gnome.org/Projects/Vala/Hacking#Coding_Style  and Elementary OS 
write their apps in Vala and they seem  to be using similar:  
https://elementary.io/docs/code/reference#code-style  Although Yorba take a 
different approach:  https://wiki.gnome.org/Apps/Geary/CodingConventions   
That's code formatting style, but also Vala is seen  generally as an object 
oriented language so you want  to be thinking about classes and interfaces. 
Starting to  get an understanding of design patterns by the so-called  Gang 
of Four and also the SOLID principles helped me. This is  the first 
thing I've written in vala.  Partially, the find command is   less than 
optimal because I want to include the code within another   program.    I 
use find and it took a while for me to get to grips with it  so I thought I 
would share a tip based on what I use. Many languages include a simple 
filewalking approach, and I   was somewhat surprised that I couldn't find one 
within vala, so   partially I was looking for a pointer to a library that I 
had overlooked.That's interesting, for low level stuff GLib is often the 
firstplace to look. The best I could find was this StackOverflow answer  
http://stackoverflow.com/questions/2217519/how-to-walk-a-directory-in-c  One 
answer pointed to GFileEnumerator. Code examples on Valadoc:  
http://valadoc.org/#!api=gio-2.0/GLib.FileEnumerator  but not recursive from 
what I can see.  And partially I was looking for pointers as to where 
the community  recommended that beginners post code and look for tips. 
I haven't been really pleased by the documentation of vala that I could   
find, so I was hoping that there was someplace better than the mailing   
list...and a bit over 24 hours for the first response isn't   encouraging.  
OTOH, the civil response *is* encouraging.  ValaDoc is   greatly improved 
over the last time I investigated vala, but many things   still seem to 
assume that you are coming from a background of C   coding...and that you 
remember the C libraries.  My most recent   background is Python and D, so 
I'm often left in confusion until I dig   back deeper...which slows 
everything down. You could try StackOverflow:  
http://stackoverflow.com/questions/tagged/vala   One of Vala's key points is 
its strong compatibility  with C. This enables a lot of libraries to be used 
in  a modern object oriented way without having to rewrite  the libraries. 
This does mean though you may have to start  a search with how something is 
done in C, often GLib,  and then see if their is a Vala translation.
Being able to recognise some basic C interfaces has a  lot less cognitive load 
that trying to write good,  scalable code in C.   As to response times that 
is a function of the number  of people you are addressing and whether your 
question  piques their interest. The larger the community the more  chance of 
getting someone's interest and they will then  take the time to write a 
response. Vala certainly has a  smaller community than Python. 
   On 07/27/2015 12:57 PM, Al Thomas wrote:    From: Charles Hixson   
   Sent: Sunday, 26 July 2015, 21:09    Subject: [Vala] Simple 
filewalker code.  Comments?  T his is working filewalker code, but 
I'm hoping someone will tell   me if    this is the correct approach.  
  correctness depends on your criteria. You say it works so it is   
correct.  If on the other hand you want to be productive. Why 
reinvent the wheel?    Why not just use something like the 'find' command 
line tool, e.g.    find ./ -type d -exec du --human-readable '{}' \;    
will apply the disk usage command to each file in the current directory.    
It is a trivial example that just shows how much space each file takes up.   
   If you want to create a program with a bit more flexibility. Create a  
  list of file paths in the first step. Then apply a filter function    to 
each path, so you would use this to remove directories and then    another 
filter function to remove symlinks, as per your current program.    This 
allows you to add other filters later.    Once you have a good list iterate 
over it and call your function, or   functions    if you add more in 
future, with the file path as the parameter.  For a list exmaple see: 
   

[Vala] Network Packet Cleaner

2014-07-22 Thread raum
Hello,

I've informed you monthes ago that I was trying to code an application
that graphically manipulate a pcap file (removing hosts, connections or
sessions, etc.) using Vala.

I'm sorry to say I don't have enough time to get a good version.

So I've uploaded all my code to github.
https://github.com/Raumy/libnetframes
A library which contains various classes to handle a pcap file.
You could use this library in stand alone for others applications.
- It uses : tshark, libpcap.
- It should : compile under Linux and Windows.
See examples directory.

https://github.com/Raumy/npc
the original graphical application, using GTK and libnetframes.
You should add the directory where libnetframes is located to your lib
path if you want to execute npc.

Under Windows, you need to install mingw32 and a lot of files... :)

I've some difficulty to make the Data Exchange Chart...

You can use this code as example or contribute, or give me advice for a
better code.

Some comments in my code are in french, sorry ;)

Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Problem to handle shift key

2013-12-12 Thread Raum

Hello,

I've got a new problem :)  This code works on windows but not on linux 
and I don't understand why ?!?


- CODE  gtk_test.vala ---
public class Application   {
public Gtk.Window window;
public Application () {
window = new Gtk.Window();
// Prepare Gtk.Window:
window.title = test;
window.window_position = Gtk.WindowPosition.CENTER;
window.destroy.connect (Gtk.main_quit);
window.set_default_size (350, 70);

window.add_events(Gdk.EventMask.KEY_RELEASE_MASK);
window.add_events(Gdk.EventMask.KEY_PRESS_MASK);
window.key_release_event.connect(on_key_press);
window.key_press_event.connect(on_key_press);
}

public  bool on_key_press (Gdk.EventKey event) {
stdout.printf (state : %d / shift modifier should be : %d\n, 
event.state, Gdk.ModifierType.SHIFT_MASK);

return true;
}

public static int main (string[] args) {
Gtk.init (ref args);

Application app = new Application ();
app.window.show_all ();
Gtk.main ();
return 0;
}
}
-
// Ubuntu 11.04

# valac --pkg gtk+-3.0 gtk_test.vala
# ./gtk_test
state : 0 / shift modifier should be : 1   // I've pressed shift I 
should see 1 / 1 and not 0 / 1
state : 1 / shift modifier should be : 1 // I've released shift, I see 
1/1, it's ok


--

I didn't compile this code on Windows/MingW but I've a similar code 
which working...


Where am I wrong ?

Thanks

Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Problem to handle shift key

2013-12-12 Thread Raum

Hello,

I've got a new problem :)  This code works on windows but not on linux 
and I don't understand why ?!?


- CODE  gtk_test.vala ---
public class Application   {
public Gtk.Window window;
public Application () {
window = new Gtk.Window();
// Prepare Gtk.Window:
window.title = test;
window.window_position = Gtk.WindowPosition.CENTER;
window.destroy.connect (Gtk.main_quit);
window.set_default_size (350, 70);

window.add_events(Gdk.EventMask.KEY_RELEASE_MASK);
window.add_events(Gdk.EventMask.KEY_PRESS_MASK);
window.key_release_event.connect(on_key_press);
window.key_press_event.connect(on_key_press);
}

public  bool on_key_press (Gdk.EventKey event) {
stdout.printf (state : %d / shift modifier should be : %d\n, 
event.state, Gdk.ModifierType.SHIFT_MASK);

return true;
}

public static int main (string[] args) {
Gtk.init (ref args);

Application app = new Application ();
app.window.show_all ();
Gtk.main ();
return 0;
}
}
-
// Ubuntu 11.04

# valac --pkg gtk+-3.0 gtk_test.vala
# ./gtk_test
state : 0 / shift modifier should be : 1   // I've pressed shift I 
should see 1 / 1 and not 0 / 1
state : 1 / shift modifier should be : 1 // I've released shift, I see 
1/1, it's ok


--

I didn't compile this code on Windows/MingW but I've a similar code 
which working...


Where am I wrong ?

Thanks

Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Performance issue

2013-11-28 Thread Raum

Hello

I'm developping a tool which graphically display a pcap file.

I'm using treeview / TreeModel / TreeStore to show a lot of frames information 
and I've some performance issues... notably on navigator view.

Is there any optimization tool (under linux) ? (which can give me some 
informations where I should optimize my code ?)

If you want to experiment the lags, check version 1.4 on
https://sourceforge.net/projects/netpackclean/   and give me your opinion


Thanks

Regards

Raum

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Recursive foreaching

2013-11-25 Thread raum
Hello

I've tried something like that (In fact I've began to code a turn based
game... ehm... well ok... I'll explain in the future)

It's my first attempt in vala :
https://sourceforge.net/projects/valatreeobjects/files/

Really perfectible but  it's fun.

I'll try to clean up my code and use vala's best practices later (or if
someone want to have a look ;))

Regards

Raum



 I have a tree of nodes, something like this in pseudocode:
 class Node
   ArrayList kidnodes
   Node parent

 So - each node has kids and a parent.

 I find myself wanting to foreach over the tree from code that is not
 within a Node.

 Right now, I'm doing this kind of thing:

 class Node
...
public void walk( somelist)
  foreach(kid in kidnodes)
somelist.add (kid) //visit.
walk( somelist )

 Then, in some other object:
 var list = somelist
 somenode.walk(l)
 //now i can foreach through list

 Is there some way I can do:

 somenode = rootnode; //say
 foreach( node in somenode)
visit(node)

 so that it visits the nodes like walk does?



 \d
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Finally first release of my tool Network Packet Cleaner ^__^

2013-10-31 Thread raum
Hello,

I'm proud to present my Packet Cleaner tool ! (ehm no imagination for a
good name so it's Network Packet Cleaner :-/)

I've asked a lot of questions about how to handle files, how to use GTK,
etc... and I wanted to show you the conclusion.

I'm not sure I've the right to include tshark in my binary package... :-?

Linux binary certainly at the end of day... For source code, I need to
clean and document them ;)

https://sourceforge.net/projects/netpackclean/

It was'nt so complicated to create this tools and I'll see to add a DEC
view of sessions...

Regards

Raum

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] [Fwd: Binary File is not seekable ?!?]

2013-10-28 Thread raum
from http://valadoc.org/#!api=gio-2.0/GLib.Seekable
seek on FileIOStream run without error but seeking with DataInputStream
throw an error but none on Windows... :-?
I will try to change my source code to test.

code sample.vala
public static int main (string[] args) {
File file = File.new_for_path (my-test.txt);

try {
FileIOStream ios =  file.open_readwrite();

// no error
assert (ios.can_seek ());
// no error
ios.seek (11, SeekType.SET);

InputStream @is = ios.input_stream;
DataInputStream dis = new DataInputStream (@is);

string line;
while ((line = dis.read_line ()) != null) {
stdout.puts (line);
stdout.putc ('\n');
}

// display error
dis.seek(0,SeekType.SET);

} catch (Error e) {
stdout.printf (Error: %s\n, e.message);
}

return 0;
}


OUTPUT

$ cat my-test.txt
My first line
My second line

$ valac --pkg gio-2.0 sample.vala
cyriac@arche:~/src$ ./sample
ne
My second line

(process:29159): GLib-GIO-CRITICAL **: g_seekable_seek: assertion
`G_IS_SEEKABLE (seekable)' failed

 I've downloaded source tarball of Vala 0.22, compiled and install it but
 no effect... :-/

 I was wondering if it was not a system problem. But I can not admit that I
 would have to reinstall linux to make it work. I'll search for reinstall
 only glib

 Thanks

 Raum

 Seems like it is problem with glib2 package, try to reinstall it, I
 can't
 say how it exactly called in Ubuntu, because I'm not an Ubuntu user.
  
  
  
   From:
 raum@no-log.orgSent:
 ??,
 26
 ??
 2013
 ?.
 22:17To:
 vala-list@gnome.orgSubject:
 Re:
 [Vala]
 [Fwd:
 Binary
 File
 is
 not
 seekable
 ?!?]
 Hello,

 Let me explain. I want to create a tool for Linux and Windows.

 I need to open a binary file and seek to a position... With MingW on
 Windows, it runs without error but on Linux, I've a seekable error
 with
 the same code, same compile options, etc.

 I dont understand why...

 # Code

  public void main() {
 try {
File file = File.new_for_path (test.pcap);
DataInputStream dis = new DataInputStream (file.read ());
stdout.printf(seekable: %s\n,(dis.can_seek())?true:false);
 } catch (Error e) {
 }
  }

 # WINDOWS 32bits / MingW32

 $ valac --pkg gio-2.0 seek.vala
 $ ./seek
 seekable: true

 ## LINUX -Ubuntu 13.03- 64 bits

 $ valac --pkg gio-2.0 seek.vala
 $ ./seek
 (process:8097): GLib-GIO-CRITICAL **: g_seekable_can_seek: assertion
 `G_IS_SEEKABLE (seekable)' failed
 seekable: false


 Do you have an idea why it's running on Windows but not on Linux ?

 Thanks

 Raum
 ___
 vala-list mailing list

 https://mail.gnome.org/mailman/listinfo/vala-list


 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] [Fwd: Binary File is not seekable ?!?]

2013-10-27 Thread raum
I've downloaded source tarball of Vala 0.22, compiled and install it but
no effect... :-/

I was wondering if it was not a system problem. But I can not admit that I
would have to reinstall linux to make it work. I'll search for reinstall
only glib

Thanks

Raum

 Seems like it is problem with glib2 package, try to reinstall it, I can't
 say how it exactly called in Ubuntu, because I'm not an Ubuntu user.
   
   
  
 From:
 raum@no-log.orgSent:
 ??,
 26
 ??
 2013
 ?.
 22:17To:
 vala-list@gnome.orgSubject:
 Re:
 [Vala]
 [Fwd:
 Binary
 File
 is
 not
 seekable
 ?!?]
 Hello,

 Let me explain. I want to create a tool for Linux and Windows.

 I need to open a binary file and seek to a position... With MingW on
 Windows, it runs without error but on Linux, I've a seekable error with
 the same code, same compile options, etc.

 I dont understand why...

 # Code

  public void main() {
 try {
File file = File.new_for_path (test.pcap);
DataInputStream dis = new DataInputStream (file.read ());
stdout.printf(seekable: %s\n,(dis.can_seek())?true:false);
 } catch (Error e) {
 }
  }

 # WINDOWS 32bits / MingW32

 $ valac --pkg gio-2.0 seek.vala
 $ ./seek
 seekable: true

 ## LINUX -Ubuntu 13.03- 64 bits

 $ valac --pkg gio-2.0 seek.vala
 $ ./seek
 (process:8097): GLib-GIO-CRITICAL **: g_seekable_can_seek: assertion
 `G_IS_SEEKABLE (seekable)' failed
 seekable: false


 Do you have an idea why it's running on Windows but not on Linux ?

 Thanks

 Raum
 ___
 vala-list mailing list

 https://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] [Fwd: Binary File is not seekable ?!?]

2013-10-26 Thread raum
Hello,

Let me explain. I want to create a tool for Linux and Windows.

I need to open a binary file and seek to a position... With MingW on
Windows, it runs without error but on Linux, I've a seekable error with
the same code, same compile options, etc.

I dont understand why...

# Code

 public void main() {
try {
   File file = File.new_for_path (test.pcap);
   DataInputStream dis = new DataInputStream (file.read ());
   stdout.printf(seekable: %s\n,(dis.can_seek())?true:false);
} catch (Error e) {
}
 }

# WINDOWS 32bits / MingW32

$ valac --pkg gio-2.0 seek.vala
$ ./seek
seekable: true

## LINUX -Ubuntu 13.03- 64 bits

$ valac --pkg gio-2.0 seek.vala
$ ./seek
(process:8097): GLib-GIO-CRITICAL **: g_seekable_can_seek: assertion
`G_IS_SEEKABLE (seekable)' failed
seekable: false


Do you have an idea why it's running on Windows but not on Linux ?

Thanks

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] [Fwd: Binary File is not seekable ?!?]

2013-10-25 Thread raum
Hello

Under MingW / Windows, I've this :

$ valac --pkg gio-2.0 seek.vala
(...)/seek.vala.c: In function 'main':
(...)/seek.vala.c:80:2: warning: 'g_type_init' is deprecated (declared at
D:/cross-compile/opt/include/glib-2.0/gobject
/gtype.h:669) [-Wdeprecated-declarations]

$ ./seek
seekable: true

What's going wrong ? o_O

Thanks

raum

 Message original 
Objet:   [Fwd: Binary File is not seekable ?!?]
De:  r...@no-log.org
Date:Ven 25 octobre 2013 8:51
À:   vala-list@gnome.org
--

ps: the mailing list seems to have a problem. I've posted this message
three times, I hope it appears ;) Sorry if you received it earlier.

Hello,

I'm trying to seek in a binary file...  Under MingW / Windows, I've no
problem but with linux I've a G_IS_SEEKABLE failed error :

Example of code seek.vala :
public void main() {
   try {
  File file = File.new_for_path (test.pcap);
  DataInputStream dis = new DataInputStream (file.read ());
  stdout.printf(seekable: %s\n,(dis.can_seek())?true:false);
   } catch (Error e) {
   }
}

Output :
$ ./seek

(process:8097): GLib-GIO-CRITICAL **: g_seekable_can_seek: assertion
`G_IS_SEEKABLE (seekable)' failed
seekable: false

Where am I wrong ? DataIntputStream has seekable interface...

Thanks

Regards

Raum



___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to convert a string to float ?

2013-09-24 Thread raum
Hello,

Just as I said in subject of this mail, I'm trying to convert a string
into a float.

To convert a string to int : int.parse
ok, easy...

Float... ehm.. no atof function, I've seen a lot of things about Value
so I've tried and I've got  GLib-GObject-CRITICAL **:
g_value_set_***...

So how can I convert ?

Sample code :
Value val = Value (typeof (double));
val.set_string(3.4);   //  error
stdout.printf (get_double()\n);
stdout.printf (%f\n, val.get_double());
stdout.printf (get_string()\n);
stdout.printf (%s\n, val.get_string()); // -- error

Value val2 = Value (typeof (string));
val2.set_string(3.4);
stdout.printf (get_double()\n);
stdout.printf (%f\n, val2.get_double()); // -- error
stdout.printf (get_string()\n);
stdout.printf (%s\n, val2.get_string());

OUTPUT :
---
(spawn.exe:4056): GLib-GObject-CRITICAL **: g_value_set_string: assertion
`G_VALUE_HOLDS_STRING (value)' failed
get_double()
0.00
get_string()

(spawn.exe:4056): GLib-GObject-CRITICAL **: g_value_get_string: assertion
`G_VALUE_HOLDS_STRING (value)' failed
(null)
get_double()

(spawn.exe:4056): GLib-GObject-CRITICAL **: g_value_get_double: assertion
`G_VALUE_HOLDS_DOUBLE (value)' failed
0.00
get_string()
3.4
---


Thanks

Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Header file not found ?!?

2013-09-23 Thread raum
Hello,

In fact, I've the same problem as :
http://www.perlmonks.org/?node_id=896237

$ valac --pkg libpcap -X -I/opt/include test.vala
test.vala.c: In function 'main':
test.vala.c:29:2: warning: 'g_type_init' is deprecated (declared at
C:\TEMP\cccVFFzy.o:test.vala.c:(.text+0x47): undefined reference to
`pcap_lib_version'
collect2: ld returned 1 exit status
error: cc exited with status 1
Compilation failed: 1 error(s), 0 warning(s)

I will try the fix explained in the web page.

Regards,

Raum

 On Fri, 2013-09-20 at 15:49 +0200, r...@no-log.org wrote:
 Hello,

 I'm trying to output pcap version in mingw32 environnement. I've
 installed libpcap.vapi, libpcap.deps (from
 https://github.com/apmasell/vapis) and all header and lib files from
 WpdPack.zip (WinPcap developper kit).

 I found in my /opt/include folder :
 pcap.h
 pcap/pcap.h
 ...

 CPPFLAGS=-I/opt/include

 This isn't likely to have much effect?Vala uses C, not C++.  You may
 have better luck with CFLAGS.  AFAIK Vala doesn't use the CFLAGS
 environment variable, though, so if that's what you're hoping will pick
 it up I think you're out of luck.

 If you want to get valac to pass specific C flags to the C compiler, use
 -X (valac -X -I/opt/include ...).

 C_LIBRARY_PATH=/usr/include:/mingw/include:/opt/include

 simple vala code test_pcap.vala :
 -
 void main() {
  stdout.printf (%s\n, PCap.get_version());

 }
 -

 Command to compile test code :
 $ valac --pkg gio-2.0 --pkg libpcap  test_pcap.vala
 d:/test_pcap.vala.c:8:23: fatal error: pcap/pcap.h: No such file or
 directory
 compilation terminated.
 error: cc exited with status 1
 Compilation failed: 1 error(s), 0 warning(s)
 $

 Do you have an advice ? I don't understand why valac didn't find a file
 which is obviously present in /opt/include/pcap/ folder ?

 It's actually not valac which doesn't find the header file, it's the C
 compiler.  You can always just tell valac to compile to C but not
 compile the C itself (using the -C flag), then invoke your C compiler
 manually.  Once you figure out the right flags, you can pass them to
 valac with -X.  You can also see what flags valac is passing to the C
 compiler with something like `valac --cc=echo --pkg gio-2.0 --pkg
 libpcap test_pcap.vala`.


 -Evan


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Header file not found ?!?

2013-09-20 Thread raum
Hello,

I'm trying to output pcap version in mingw32 environnement. I've
installed libpcap.vapi, libpcap.deps (from
https://github.com/apmasell/vapis) and all header and lib files from
WpdPack.zip (WinPcap developper kit).

I found in my /opt/include folder :
pcap.h
pcap/pcap.h
...

CPPFLAGS=-I/opt/include
C_LIBRARY_PATH=/usr/include:/mingw/include:/opt/include

simple vala code test_pcap.vala :
-
void main() {
stdout.printf (%s\n, PCap.get_version());

}
-

Command to compile test code :
$ valac --pkg gio-2.0 --pkg libpcap  test_pcap.vala
d:/test_pcap.vala.c:8:23: fatal error: pcap/pcap.h: No such file or directory
compilation terminated.
error: cc exited with status 1
Compilation failed: 1 error(s), 0 warning(s)
$

Do you have an advice ? I don't understand why valac didn't find a file
which is obviously present in /opt/include/pcap/ folder ?

Thanks

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Binding 7zip library ?

2013-08-27 Thread raum
I had a look to libarchive... It seems libarchive 3.0 could handle 7Zip
format (for reading) but unfortunately there is only a vapi file for
version 2...

I've read some pages about how to generate vapi but I didnt success...

Should I try to write by hand a vapi file ?

Thanks

 On Mon, 2013-08-26 at 11:27 +0200, r...@no-log.org wrote:
 Hello,

 I've downloaded and build 7Zip library and I've these files compiled
 (under Windows using MingW32, with prefix /opt) :

 /src/lib7zip-1.6.5/Lib7Zip/lib7zip.a
 /src/lib7zip-1.6.5/Lib7Zip/lib7zip.dll
 /src/lib7zip-1.6.5/Lib7Zip/lib7zip.h

 make install command didn't copy these files under /opt/bin,
 /opt/include, /opt/library

 The 7zip SDK really designed to be embedded within your project, not
 used as a shared library.

 I've copied manually in the correct directory but tests programs output
 :
 # test7zip.exe
 initialize fail!

 So I think I've made a mistake somewhere... But how to test it with a
 vala
 test program ? I need to build a vapi file ? something like that ?

 Yes, you would need to create VAPI.  I looked at the 7zip SDK API quite
 recently and I don't think creating a VAPI would be an easy task.  The
 API is a bit of a mess.

 I'm not sure what your use case is.  If you need to read and write *.7z
 files you might want to look at libarchive?I'm not sure whether they
 support 7zip or not, but if they do then it would be a much easier way
 to go since it already has a VAPI.

 If you just want to compress stuff you might want to take a look at a
 project I've been working on called Squash [1], which does have Vala
 bindings.  It is an abstraction layer for compression libraries (not
 archivers?that's what libarchive is for), and it supports most of the
 algorithms 7zip uses.

 I do plan to write a Squash plugin for the 7zip SDK eventually [2], and
 if you really need PPMD, BCJ, or BCJ2 (Squash already supports LZMA,
 LZMA2, bzip2, and DEFLATE) I can take a look at that sooner rather than
 later, but keep in mind that it will not support *.7z archives.

 Also, if you're not tied to 7zip, you may want to look at FreeArc [3].
 I don't remember if they have an API you could use or not, but the PPM
 compression is better, and the other algorithms are great [4].  Or, if
 all you care about is compression ratio, ZPAQ [5] (for which there is a
 Squash plugin) is amazing.


 -Evan

 [1] http://quixdb.github.io/squash/
 [2] https://github.com/quixdb/squash/issues/31
 [3] http://freearc.org/
 [4] http://compressionratings.com/i_freearc.html
 [5] http://mattmahoney.net/dc/zpaq.html



___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Binding 7zip library ?

2013-08-27 Thread raum
Sorry, I've sent the wrong vapi file. Please find in attachement the
correct files.

Regards

Raum


 I'm not sure but a compatible version 3 libarchive.vapi should be similar
 to these files in attachement.

 Am I correct ?

 Indeed I need to read 7zip, not write a 7zip archive. :)

 Thanks for all informations you provided me ;)

 Regards,

 Raum

 On Tue, 2013-08-27 at 08:46 +0200, r...@no-log.org wrote:
 I had a look to libarchive... It seems libarchive 3.0 could handle 7Zip
 format (for reading) but unfortunately there is only a vapi file for
 version 2...

 I've read some pages about how to generate vapi but I didnt
 success...

 Should I try to write by hand a vapi file ?

 libarchive is not GObject-based, so it's not possible to generate a vapi
 automatically.  Writing it by hand is your only option.

 libarchive 3 is compatible with previous versions, so there is no need
 to create a new VAPI.  Just add what you need to the existing bindings.


 Thanks

  On Mon, 2013-08-26 at 11:27 +0200, r...@no-log.org wrote:
  Hello,
 
  I've downloaded and build 7Zip library and I've these files compiled
  (under Windows using MingW32, with prefix /opt) :
 
  /src/lib7zip-1.6.5/Lib7Zip/lib7zip.a
  /src/lib7zip-1.6.5/Lib7Zip/lib7zip.dll
  /src/lib7zip-1.6.5/Lib7Zip/lib7zip.h
 
  make install command didn't copy these files under /opt/bin,
  /opt/include, /opt/library
 
  The 7zip SDK really designed to be embedded within your project, not
  used as a shared library.
 
  I've copied manually in the correct directory but tests programs
 output
  :
  # test7zip.exe
  initialize fail!
 
  So I think I've made a mistake somewhere... But how to test it with
 a
  vala
  test program ? I need to build a vapi file ? something like that ?
 
  Yes, you would need to create VAPI.  I looked at the 7zip SDK API
 quite
  recently and I don't think creating a VAPI would be an easy task.
 The
  API is a bit of a mess.
 
  I'm not sure what your use case is.  If you need to read and write
 *.7z
  files you might want to look at libarchive?I'm not sure whether they
  support 7zip or not, but if they do then it would be a much easier
 way
  to go since it already has a VAPI.
 
  If you just want to compress stuff you might want to take a look at a
  project I've been working on called Squash [1], which does have Vala
  bindings.  It is an abstraction layer for compression libraries (not
  archivers?that's what libarchive is for), and it supports most of the
  algorithms 7zip uses.
 
  I do plan to write a Squash plugin for the 7zip SDK eventually [2],
 and
  if you really need PPMD, BCJ, or BCJ2 (Squash already supports LZMA,
  LZMA2, bzip2, and DEFLATE) I can take a look at that sooner rather
 than
  later, but keep in mind that it will not support *.7z archives.
 
  Also, if you're not tied to 7zip, you may want to look at FreeArc
 [3].
  I don't remember if they have an API you could use or not, but the
 PPM
  compression is better, and the other algorithms are great [4].  Or,
 if
  all you care about is compression ratio, ZPAQ [5] (for which there is
 a
  Squash plugin) is amazing.
 
 
  -Evan
 
  [1] http://quixdb.github.io/squash/
  [2] https://github.com/quixdb/squash/issues/31
  [3] http://freearc.org/
  [4] http://compressionratings.com/i_freearc.html
  [5] http://mattmahoney.net/dc/zpaq.html
 
 







libarchive.diff.gz
Description: application/gzip


libarchive.7z
Description: Binary data
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Binding 7zip library ?

2013-08-27 Thread raum
I think it's running. I've compressed test.vala into test.7z then :

$  valac --pkg libarchive test.vala

$ ./test.exe
version libarchive 3.1.2
test.vala

Well, now I'll test files decompression :)

Raum

 Sorry, I've sent the wrong vapi file. Please find in attachement the
 correct files.

 Regards

 Raum


 I'm not sure but a compatible version 3 libarchive.vapi should be
 similar
 to these files in attachement.

 Am I correct ?

 Indeed I need to read 7zip, not write a 7zip archive. :)

 Thanks for all informations you provided me ;)

 Regards,

 Raum

 On Tue, 2013-08-27 at 08:46 +0200, r...@no-log.org wrote:
 I had a look to libarchive... It seems libarchive 3.0 could handle
 7Zip
 format (for reading) but unfortunately there is only a vapi file for
 version 2...

 I've read some pages about how to generate vapi but I didnt
 success...

 Should I try to write by hand a vapi file ?

 libarchive is not GObject-based, so it's not possible to generate a
 vapi
 automatically.  Writing it by hand is your only option.

 libarchive 3 is compatible with previous versions, so there is no need
 to create a new VAPI.  Just add what you need to the existing bindings.


 Thanks

  On Mon, 2013-08-26 at 11:27 +0200, r...@no-log.org wrote:
  Hello,
 
  I've downloaded and build 7Zip library and I've these files
 compiled
  (under Windows using MingW32, with prefix /opt) :
 
  /src/lib7zip-1.6.5/Lib7Zip/lib7zip.a
  /src/lib7zip-1.6.5/Lib7Zip/lib7zip.dll
  /src/lib7zip-1.6.5/Lib7Zip/lib7zip.h
 
  make install command didn't copy these files under /opt/bin,
  /opt/include, /opt/library
 
  The 7zip SDK really designed to be embedded within your project, not
  used as a shared library.
 
  I've copied manually in the correct directory but tests programs
 output
  :
  # test7zip.exe
  initialize fail!
 
  So I think I've made a mistake somewhere... But how to test it with
 a
  vala
  test program ? I need to build a vapi file ? something like that ?
 
  Yes, you would need to create VAPI.  I looked at the 7zip SDK API
 quite
  recently and I don't think creating a VAPI would be an easy task.
 The
  API is a bit of a mess.
 
  I'm not sure what your use case is.  If you need to read and write
 *.7z
  files you might want to look at libarchive?I'm not sure whether they
  support 7zip or not, but if they do then it would be a much easier
 way
  to go since it already has a VAPI.
 
  If you just want to compress stuff you might want to take a look at
 a
  project I've been working on called Squash [1], which does have Vala
  bindings.  It is an abstraction layer for compression libraries (not
  archivers?that's what libarchive is for), and it supports most of
 the
  algorithms 7zip uses.
 
  I do plan to write a Squash plugin for the 7zip SDK eventually [2],
 and
  if you really need PPMD, BCJ, or BCJ2 (Squash already supports LZMA,
  LZMA2, bzip2, and DEFLATE) I can take a look at that sooner rather
 than
  later, but keep in mind that it will not support *.7z archives.
 
  Also, if you're not tied to 7zip, you may want to look at FreeArc
 [3].
  I don't remember if they have an API you could use or not, but the
 PPM
  compression is better, and the other algorithms are great [4].  Or,
 if
  all you care about is compression ratio, ZPAQ [5] (for which there
 is
 a
  Squash plugin) is amazing.
 
 
  -Evan
 
  [1] http://quixdb.github.io/squash/
  [2] https://github.com/quixdb/squash/issues/31
  [3] http://freearc.org/
  [4] http://compressionratings.com/i_freearc.html
  [5] http://mattmahoney.net/dc/zpaq.html
 
 





 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list


test.vala
Description: Binary data
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Binding 7zip library ?

2013-08-26 Thread raum
Hello,

I've downloaded and build 7Zip library and I've these files compiled
(under Windows using MingW32, with prefix /opt) :

/src/lib7zip-1.6.5/Lib7Zip/lib7zip.a
/src/lib7zip-1.6.5/Lib7Zip/lib7zip.dll
/src/lib7zip-1.6.5/Lib7Zip/lib7zip.h

make install command didn't copy these files under /opt/bin,
/opt/include, /opt/library

I've copied manually in the correct directory but tests programs output :
# test7zip.exe
initialize fail!

So I think I've made a mistake somewhere... But how to test it with a vala
test program ? I need to build a vapi file ? something like that ?

Thanks

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to get date/time infos from a file ?

2013-08-21 Thread raum
Hello,

I'm trying to get informations like TIME_ACCESS, TIME_CREATED, ... from a
file but I don't know how.

For example :
   var file = File.new_for_path (some_file.txt);
   var file_info = file.query_info (FILE_ATTRIBUTE_STANDARD_NAME + , +
FILE_ATTRIBUTE_STANDARD_TYPE, 0);
   int64 file_stamp =
file_info.get_attribute_int64(FileAttribute.TIME_ACCESS);

   stdout.printf (% + int64.FORMAT + \n, file_stamp);

return :
0

Someone could help me ? :)

Thanks

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to get date/time infos from a file ?

2013-08-21 Thread raum
Well, Im' trying something like :
var file = File.new_for_path (some_file.txt);
var file_info = file.query_info (*::*, 0);
int64 file_stamp =
 file_info.get_attribute_int64(FileAttribute.TIME_ACCESS);

stdout.printf (% + int64.FORMAT + \n, file_stamp);

But result is 0 :-?

where am I wrong ?


 On Mi, 2013-08-21 at 14:41 +0200, r...@no-log.org wrote:
 Hello,

 I'm trying to get informations like TIME_ACCESS, TIME_CREATED, ... from
 a
 file but I don't know how.

 For example :
var file = File.new_for_path (some_file.txt);

 You have to add things you want to extract from the FileInfo on the line
 below also in the line here (or use * to get everything).

var file_info = file.query_info (FILE_ATTRIBUTE_STANDARD_NAME + , +
 FILE_ATTRIBUTE_STANDARD_TYPE, 0);
int64 file_stamp =
 file_info.get_attribute_int64(FileAttribute.TIME_ACCESS);

stdout.printf (% + int64.FORMAT + \n, file_stamp);


 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Int64 operations, I'm confused

2013-07-31 Thread raum
My problem is not how to ouput an int64 but I need to divide a int64 by 8
and store the result in int type...

  int64 val6 = 96;
  int val7 = (int) (val6 / 8);

val7 = 0 ? Why ?

$ test
val1: 96, val2 : 0
val4: 96, val5 : 12
val6: 96, val7 : 0
$

Thanks

 You can also use int64.FORMAT like this:

 stdout.printf (val1: +int64.FORMAT+\n, val1);

 This is because stdout.printf is using libc's fprintf function, instead
 of the glib one. The windows libc uses the %I64d format instead of
 %lld, so it fails.

 Use the portable way instead, or just use glib format functions only.

 On 07/30/13 16:57, Simon Kågedal Reimer wrote:
 The problem is that %lld doesn't work at all on Windows. Read the
 e-mail Steven linked to again. :) You could try the following:

 void main () {
  int64 val1 = 96;
  int64 val2 = val1 / 8;
  stdout.printf (@val1: $val1, val2: $val2\n);

  int val4 = 96;
  int val5 = val4 / 8;
  stdout.printf (@val4: $val4, val5: $val5\n);

  int64 val6 = 96;
  int val7 = (int) (val6 / 8);
  stdout.printf (@val6: $val6, val7: $val7\n);
 }
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list


 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Int64 operations, I'm confused

2013-07-31 Thread raum
Ok, the value stored in int type variable is correct (I mean 12) but try
the following code :

void main() {
int64 val6 = 96;
int val7 = (int) (val6 / 8);
stdout.printf (val6: %lld, val7 : %d\n, val6, val7);
stdout.printf (%d\n, val7);
}

output :
$ a
val6: 96, val7 : 0
12

Int64 is correctly disdplayed with %lld format, int is not correctly
displayed at first.

Strange ? isn'it ? :)

But ok, I've got the right value.


generated C code :
/* a.c generated by valac 0.20.1, the Vala compiler
 * generated from a.vala, do not modify */

#include glib.h
#include glib-object.h
#include stdio.h




void _vala_main (void);


void _vala_main (void) {
gint64 val6;
gint val7;
FILE* _tmp0_;
FILE* _tmp1_;
val6 = (gint64) 96;
val7 = (gint) (val6 / 8);
_tmp0_ = stdout;
fprintf (_tmp0_, val6: %lld, val7 : %d\n, val6, val7);
_tmp1_ = stdout;
fprintf (_tmp1_, this is correct : %d\n, val7);
}


int main (int argc, char ** argv) {
g_type_init ();
_vala_main ();
return 0;
}






 not for me

 On 07/31/13 10:27, r...@no-log.org wrote:
  int64 val6 = 96;
int val7 = (int) (val6 / 8);

 $ cat a.vala
 void main() {
  int64 val6 = 96;
  int val7 = (int) (val6 / 8);
  stdout.printf (%d\n, val7);
 }
 $ vala a.vala
 12

 If you use the wrong format string you are going to display wrong data.

 This is, windows is 32bit, and values are pushed on the stack from 4
 bytes to 4, if the printf format expects a 64bit value it will fetch 4
 bytes from the value and 4 bytes more from the stack (which can be zero
 or any other value) causing the output you see.

 Please, use the proper format string.

 You can see the C code to verify if the compiler does it right, but you
 didnt provided the valac version and I doubt vala can do such a simple
 operation wrong.

 --pancake

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Int64 operations, I'm confused

2013-07-31 Thread raum
Ehm, ok, I've finally understood :)

I've read too fast your first answer, sorry... (and english is not my
natural langage...)

Ok, well, thanks a lot :)

Regards

Raum

 Nope, it is not strange, it is what it should be.

 %lld is not valid on windows, so it is taken as %d. so if you dont use
 the right format windows will execute this:

stdout.printf (val6: %d, val7 : %d\n, val6, val7);

 instead of

stdout.printf (val6: %lld, val7 : %d\n, val6, val7);

 What happens here is that %d will get the first 4 bytes of val6 and the
 second %d will get the next 4 bytes of val6. Resulting in 96 and 0.
 (little endian matters here).

 So again, please use the correct, portable format strings. %lld is not
 portable. It will work on all known unixes, but fail on windows because
 they use %I64d.

 On 07/31/13 10:54, r...@no-log.org wrote:
 Ok, the value stored in int type variable is correct (I mean 12) but try
 the following code :

 void main() {
  int64 val6 = 96;
  int val7 = (int) (val6 / 8);
  stdout.printf (val6: %lld, val7 : %d\n, val6, val7);
  stdout.printf (%d\n, val7);
 }

 output :
 $ a
 val6: 96, val7 : 0
 12

 Int64 is correctly disdplayed with %lld format, int is not correctly
 displayed at first.

 Strange ? isn'it ? :)

 But ok, I've got the right value.


 generated C code :
 /* a.c generated by valac 0.20.1, the Vala compiler
   * generated from a.vala, do not modify */

 #include glib.h
 #include glib-object.h
 #include stdio.h




 void _vala_main (void);


 void _vala_main (void) {
  gint64 val6;
  gint val7;
  FILE* _tmp0_;
  FILE* _tmp1_;
  val6 = (gint64) 96;
  val7 = (gint) (val6 / 8);
  _tmp0_ = stdout;
  fprintf (_tmp0_, val6: %lld, val7 : %d\n, val6, val7);
  _tmp1_ = stdout;
  fprintf (_tmp1_, this is correct : %d\n, val7);
 }


 int main (int argc, char ** argv) {
  g_type_init ();
  _vala_main ();
  return 0;
 }






 not for me

 On 07/31/13 10:27, r...@no-log.org wrote:
   int64 val6 = 96;
 int val7 = (int) (val6 / 8);

 $ cat a.vala
 void main() {
   int64 val6 = 96;
   int val7 = (int) (val6 / 8);
   stdout.printf (%d\n, val7);
 }
 $ vala a.vala
 12

 If you use the wrong format string you are going to display wrong data.

 This is, windows is 32bit, and values are pushed on the stack from 4
 bytes to 4, if the printf format expects a 64bit value it will fetch 4
 bytes from the value and 4 bytes more from the stack (which can be zero
 or any other value) causing the output you see.

 Please, use the proper format string.

 You can see the C code to verify if the compiler does it right, but you
 didnt provided the valac version and I doubt vala can do such a simple
 operation wrong.

 --pancake





___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Int64 operations, I'm confused

2013-07-30 Thread raum
There is something I do not understand. I try to make a simple operation
and here is the result.
(...)
int64 val1 = 96;
int64 val2 = val1 / 8;
stdout.printf (val1: %lld, val2 : %d\n, val1, val2);

int val4 = 96;
int val5 = val4 / 8;
stdout.printf (val4: %lld, val5 : %d\n, val4, val5);

(..)

Results :
val1: 96, val2 : 0
val4: 96, val5 : 12

In fact I want to use file.query_info() which returns an int64 for size
(actually 96 bytes). And I need to divide size by 8 result = 0

Any advice ? :)

Thanks
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Int64 operations, I'm confused

2013-07-30 Thread raum
Ooops, wrong cut  paste, I mean :

(...)
int64 val1 = 96;
int64 val2 = val1 / 8;
stdout.printf (val1: %lld, val2 : %lld\n, val1, val2);

int val4 = 96;
int val5 = val4 / 8;
stdout.printf (val4: %d, val5 : %d\n, val4, val5);

int64 val6 = 96;
int val7 = (int) (val6 / 8);
stdout.printf (val6: %lld, val7 : %d\n, val6, val7);
(...)

Results :
val1: 96, val2 : 0
val4: 96, val5 : 12
val6: 96, val7 : 0

I'm using valac under Windows, using MingW.



 You've not hit an issue with using lld have you?

 https://mail.gnome.org/archives/vala-list/2012-May/msg00032.html

 Steven N. Oliver


 On Tue, Jul 30, 2013 at 9:44 AM, r...@no-log.org wrote:

 There is something I do not understand. I try to make a simple operation
 and here is the result.
 (...)
 int64 val1 = 96;
 int64 val2 = val1 / 8;
 stdout.printf (val1: %lld, val2 : %d\n, val1, val2);

 int val4 = 96;
 int val5 = val4 / 8;
 stdout.printf (val4: %lld, val5 : %d\n, val4, val5);

 (..)

 Results :
 val1: 96, val2 : 0
 val4: 96, val5 : 12

 In fact I want to use file.query_info() which returns an int64 for size
 (actually 96 bytes). And I need to divide size by 8 result = 0

 Any advice ? :)

 Thanks
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How track memory leaks ?

2013-03-18 Thread raum
Hello,

I wondered if it 's possible to recover memory information or memory leaks
 other than mem_set_vtable(mem_profiler_table); and without using a
third party software like valgrind ?

Thanks

Raum


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] [ANNOUNCE] Vala 0.19.0 - Compiler for the GObject type system

2013-02-21 Thread raum
Hello

You could try this package I've just compiled. It's running under MingW.

http://linbox.free.fr/cross-compile/binaries/vala-0.19.0-bin.tar.xz

And check this directory for libs and more :
http://linbox.free.fr/cross-compile/binaries

Regards

Raum

 On Wed, 20 Feb 2013 22:48:41 +0100
 Jürg Billeter j...@bitron.ch wrote:

 We are pleased to announce version 0.19.0 of Vala, a compiler for
 the GObject type system.

 Vala 0.19.0 is now available for download at:
http://download.gnome.org/sources/vala/0.19/



 Is there a Win7 binary package available somewhere?


 --
,,,
   (  °  dukeofp...@ml1.net
   ( / )  Linux User since 1995
   | |

 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] g_object_unref: assertion `G_IS_OBJECT (object)' failed

2012-12-12 Thread raum
Hello,

Could you have a look to this code :
http://pastebin.com/cscSFCEP

My file name is template5.vala (yes, I've tried 4 times but without any
success :p)
---
# valac --pkg gee-1.0 template5.vala
# template5
adding test2
size: 1
++-- (null)

(template5.exe:4756): GLib-GObject-CRITICAL **: g_object_unref: assertion
`G_IS_OBJECT (object)' failed

---

The main function have this code :
cObject o1 = new cObject(test1);
o1.add(new cObject(test2)); // I've written name variable in add
method, so it shows adding test2... k

stdout.printf (size : %d\n, o1.size); // it prints size: 1 so object
test2 has been added to o1... I think...

cObject o2 = o1.get(0);
stdout.printf (++-- %s\n, o2.name); // it shows null and the
assertion error

Thanks

Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] g_object_unref: assertion `G_IS_OBJECT (object)' failed

2012-12-12 Thread raum
Ehm... you were right... thanks !! *\o/*

^__^

Regards

Raum

 On 12/12/2012 03:54 PM, r...@no-log.org wrote:
 Hello,

 Could you have a look to this code :
 http://pastebin.com/cscSFCEP

 My file name is template5.vala (yes, I've tried 4 times but without any
 success :p)
 ---
 # valac --pkg gee-1.0 template5.vala
 # template5
 adding test2
 size: 1
 ++-- (null)

 (template5.exe:4756): GLib-GObject-CRITICAL **: g_object_unref:
 assertion
 `G_IS_OBJECT (object)' failed

 ---

 The main function have this code :
 cObject o1 = new cObject(test1);
 o1.add(new cObject(test2)); // I've written name variable in add
 method, so it shows adding test2... k

 stdout.printf (size : %d\n, o1.size); // it prints size: 1 so object
 test2 has been added to o1... I think...

 cObject o2 = o1.get(0);
 stdout.printf (++-- %s\n, o2.name); // it shows null and the
 assertion error

 Thanks

 Regards

 Raum
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list
 This is a bug in vala, see
 https://bugzilla.gnome.org/show_bug.cgi?id=597488

 The workaround is to initialize your ArrayList in the constructor:

 public cAbstractObject () {
  _objects = new ArrayListG ();
 }


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Avail : Vala 0.18.0, GTK 3.6, Glade 3.14

2012-10-26 Thread Raum

Have fun

http://linbox.free.fr/cross-compile/index.php

or directly http://linbox.free.fr/cross-compile/binaries/packages/

It seems all is running without crash

I'll add how to use my install and compile scripts later ;) (check 
http://linbox.free.fr/cross-compile/binaries/install/ et 
http://linbox.free.fr/cross-compile/binaries/src).


Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] [VALA] Problem with textview (it resize automatically...)

2012-10-18 Thread raum
Hi,

I've got a problem with Gtk 3 / Glade... When I add too much lines in my
textview, it gets bigger and recovers the other widgets of my window !


Below, you could see my code... Where am I wrong ? Any advice ??

thanks

Regards

-- TEST4.VALA ---

using Gtk;

class TestApp  : Gtk.ApplicationWindow {
const string UI = test.ui;
public Window main_window;
public TextView tview;
public TextBuffer buffer;

public TestApp() {
Builder builder = new Builder();
builder.add_from_file(UI);
main_window = builder.get_object(window1) as Window;
main_window.destroy.connect(Gtk.main_quit);
builder.connect_signals(this);

tview = builder.get_object(textview1) as Gtk.TextView;
buffer = tview.get_buffer();
for (int i = 0; i  25; i++)
buffer.text += test  + i.to_string() + \n;
}

[CCode (cname = G_MODULE_EXPORT on_start)]
public void on_start(Button source){
var messagedialog = new Gtk.MessageDialog (main_window,
Gtk.DialogFlags.MODAL,
Gtk.MessageType.WARNING,
Gtk.ButtonsType.OK_CANCEL,
This action will cause the universe to stop
existing.);

if (messagedialog.run() == ResponseType.OK) {
stdout.printf (tata\r\n);
messagedialog.destroy();
}
}

}

void main(string[] args) {
Gtk.init (ref args);
TestApp h = new TestApp();
h.main_window.show_all();
Gtk.main();
}

 TEST.UI 
?xml version=1.0 encoding=UTF-8?
interface
  !-- interface-requires gtk+ 3.0 --
  object class=GtkWindow id=window1
property name=width_request600/property
property name=height_request400/property
property name=can_focusFalse/property
property name=resizableFalse/property
child
  object class=GtkLayout id=layout1
property name=visibleTrue/property
property name=can_focusFalse/property
child
  object class=GtkButton id=start
property name=label translatable=yesbutton/property
property name=width_request119/property
property name=height_request32/property
property name=visibleTrue/property
property name=can_focusTrue/property
property name=receives_defaultTrue/property
property name=image_positiontop/property
signal name=clicked handler=on_start swapped=no/
  /object
  packing
property name=x15/property
property name=y360/property
  /packing
/child
child
  object class=GtkTextView id=textview1
property name=visibleTrue/property
property name=can_focusFalse/property
property name=resizableFalse/property
property name=width_request450/property
property name=height_request300/property

  /object
  packing
property name=x15/property
property name=y16/property
  /packing
/child
  /object
/child
  /object
/interface

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Problem with textview (it resize automatically...)

2012-10-18 Thread raum
I may have asked a bit too soon.

It seems TextView must go inside a scrolled window.

Forgive me ^___^

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Packaged installation (gcc 4.6.2, vala 0.18)

2012-10-08 Thread raum
Hello,

I'm continuing with clang and gtk

Really simple indeed... :)

I've downloaded these bundles :
http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip

and from http://llvm.org/releases/download.html :
http://llvm.org/releases/3.1/clang+llvm-3.1-i386-mingw32-EXPERIMENTAL.tar.bz2

I've extracted these archives in /usr/local (or d:\cross-compile\mingw).

---

$ export CC=clang
$ valac hello.vala
$ hello
Hello world !

$ valac --pkg gtk+-2.0 -X -lgtk-win32-2.0 gtk1.vala
gtk+-2.0.vapi:5802.40-5802.42: warning: Gtk is deprecated. Use gtk+-3.0
gtk1.vala:6.5-6.7: warning: Gtk is deprecated. Use gtk+-3.0
gtk1.vala:13.29-13.31: warning: Gtk is deprecated. Use gtk+-3.0
gtk1.vala:23.5-23.7: warning: Gtk is deprecated. Use gtk+-3.0
Compilation succeeded - 4 warning(s)
$ gtk1

== I've got an error : (..) you are using an unsupported compiler

second try:
$ export CC=gcc
$ valac --pkg gtk+-2.0 -X -lgtk-win32-2.0 gtk1.vala
gtk+-2.0.vapi:5802.40-5802.42: warning: Gtk is deprecated. Use gtk+-3.0
gtk1.vala:6.5-6.7: warning: Gtk is deprecated. Use gtk+-3.0
gtk1.vala:13.29-13.31: warning: Gtk is deprecated. Use gtk+-3.0
gtk1.vala:23.5-23.7: warning: Gtk is deprecated. Use gtk+-3.0
Compilation succeeded - 4 warning(s)
$ gtk1

It's running !

$ valac --pkg gtk+-3.0 -X -lgtk-win32-2.0 gtk1.vala
l:/programmation/gtk1.vala.c:11:21: fatal error: gtk/gtk.h: No such file
or directory
compilation terminated.
error: cc exited with status 1
Compilation failed: 1 error(s), 0 warning(s)
$

So... ehm.. I'll use --pkg gtk+-2.0 ^___^ (except if you have any idea :) )

Regards

Raum


- GTK1.VALA -
using Gtk;

int main (string[] args) {
Gtk.init (ref args);

var window = new Window ();
window.title = First GTK+ Program;
window.border_width = 10;
window.window_position = WindowPosition.CENTER;
window.set_default_size (350, 70);
window.destroy.connect (Gtk.main_quit);

var button = new Button.with_label (Click me!);
button.clicked.connect (() = {
button.label = Thank you;
});

window.add (button);
window.show_all ();

Gtk.main ();
return 0;
}




 Le 05/10/2012 22:25, Raum a écrit :
 Well, I'll provide an installation in the following directories :
 d:\cross-compile\mingw (linked to /usr/local)
 d:\cross-compile\msys (linked to /usr)

 At the end of the process, the files will occupied 250 MB

 Link to Mingw32 sourceforge :
 http://sourceforge.net/projects/mingw/files/

 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 MSYS Installation MSYS

 Download the following packages
 bash-3.1.17-4-msys-1.0.16-bin
 bison-2.4.2-1-msys-1.0.13-bin
 coreutils-5.97-3-msys-1.0.13-bin
 diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin
 findutils-4.4.2-2-msys-1.0.13-bin
 flex-2.5.35-2-msys-1.0.13-bin
 gawk-3.1.7-2-msys-1.0.13-bin
 grep-2.5.4-2-msys-1.0.13-bin
 libiconv-1.13.1-2-msys-1.0.13-dll-2
 libintl-0.17-2-msys-dll-8
 libregex-1.20090805-2-msys-1.0.13-dll-1
 libtermcap-0.20050421_1-2-msys-1.0.13-dll-0
 m4-1.4.14-1-msys-1.0.13-bin
 make-3.81-3-msys-1.0.13-bin
 msysCORE-1.0.17-1-msys-1.0.17-bin
 msysCORE-1.0.17-1-msys-1.0.17-dev
 msysCORE-1.0.17-1-msys-1.0.17-ext
 msysCORE-1.0.17-1-msys-1.0.17-ext
 patch-2.6.1-1-msys-1.0.13-bin
 perl-5.6.1-MSYS-1.0.11
 sed-4.2.1-2-msys-1.0.13-bin
 tar-1.23-1-msys-1.0.13-bin
 termcap-0.20050421_1-2-msys-1.0.13-bin
 texinfo-4.13a-2-msys-1.0.13-bin

 == decompress into d:\cross-compile\msys

 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 MingW and Vala installation

 Download from MingW32 :
 binutils-2.22-1-mingw32-bin
 gcc-c++-4.6.2-1-mingw32-bin
 gcc-core-4.6.2-1-mingw32-bin
 gettext-0.18.1.1-2-mingw32-bin
 gettext-0.18.1.1-2-mingw32-dev
 libexpat-2.0.1-1-mingw32-dll-1
 libgcc-4.6.2-1-mingw32-dll-1
 libgettextpo-0.18.1.1-2-mingw32-dll-0
 libgmp-5.0.1-1-mingw32-dll-10
 libiconv-1.14-2-mingw32-dev
 libiconv-1.14-2-mingw32-dll-2
 libintl-0.18.1.1-2-mingw32-dll-8
 libmpc-0.8.1-1-mingw32-dll-2
 libmpfr-2.4.1-1-mingw32-dll-1
 libstdc++-4.6.2-1-mingw32-dll-6
 libz-1.2.7-1-mingw32-dev
 libz-1.2.7-1-mingw32-dll-1
 mingwrt-3.20-mingw32-dev
 mingwrt-3.20-mingw32-dll
 pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev
 w32api-3.17-2-mingw32-dev

 Download libxml2 and iconv
 ftp://ftp.zlatkovic.com/libxml/iconv-1.9.2.win32.zip
 ftp://ftp.zlatkovic.com/libxml/libxml2-2.7.8.win32.zip

 And, at last, download from my site (http://linbox.free.fr/vala)
 vala-0.18.0-mingw32-bin.tar.xz (2,5 Mo)
 libgee-0.6.5-mingw32.tar.xz (0,5 Mo)
 libffi-3.0.11-mingw32-bin.tar.xz (61 Ko)
 glib-2.34.0-mingw32-bin.tar.xz (4,1 Mo)
 pkg-config-0.27.1-mingw32-bin.tar.xz (64 Ko)

 (DONT USE libxml2 FROM MY SITE)

 == Decompress into d:\cross-compile\mingw

 Move files from d:\cross-compile\mingw\iconv-1.9.2.win32\ to
 d:\cross-compile\mingw
 Move files from d:\cross-compile\mingw\libxml2-2.7.8.win32\ to
 d:\cross-compile\mingw
 Move files from d:\cross-compile\mingw\mingwin32\ to
 d:\cross

Re: [Vala] Packaged installation (gcc 4.6.2, vala 0.18)

2012-10-07 Thread Raum

Hello

It's ok... it's functionnal...  just a bug :)

Regards

Raum


Le 05/10/2012 22:25, Raum a écrit :

Well, I'll provide an installation in the following directories :
d:\cross-compile\mingw (linked to /usr/local)
d:\cross-compile\msys (linked to /usr)

At the end of the process, the files will occupied 250 MB

Link to Mingw32 sourceforge : 
http://sourceforge.net/projects/mingw/files/


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MSYS Installation MSYS

Download the following packages
bash-3.1.17-4-msys-1.0.16-bin
bison-2.4.2-1-msys-1.0.13-bin
coreutils-5.97-3-msys-1.0.13-bin
diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin
findutils-4.4.2-2-msys-1.0.13-bin
flex-2.5.35-2-msys-1.0.13-bin
gawk-3.1.7-2-msys-1.0.13-bin
grep-2.5.4-2-msys-1.0.13-bin
libiconv-1.13.1-2-msys-1.0.13-dll-2
libintl-0.17-2-msys-dll-8
libregex-1.20090805-2-msys-1.0.13-dll-1
libtermcap-0.20050421_1-2-msys-1.0.13-dll-0
m4-1.4.14-1-msys-1.0.13-bin
make-3.81-3-msys-1.0.13-bin
msysCORE-1.0.17-1-msys-1.0.17-bin
msysCORE-1.0.17-1-msys-1.0.17-dev
msysCORE-1.0.17-1-msys-1.0.17-ext
msysCORE-1.0.17-1-msys-1.0.17-ext
patch-2.6.1-1-msys-1.0.13-bin
perl-5.6.1-MSYS-1.0.11
sed-4.2.1-2-msys-1.0.13-bin
tar-1.23-1-msys-1.0.13-bin
termcap-0.20050421_1-2-msys-1.0.13-bin
texinfo-4.13a-2-msys-1.0.13-bin

== decompress into d:\cross-compile\msys

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MingW and Vala installation

Download from MingW32 :
binutils-2.22-1-mingw32-bin
gcc-c++-4.6.2-1-mingw32-bin
gcc-core-4.6.2-1-mingw32-bin
gettext-0.18.1.1-2-mingw32-bin
gettext-0.18.1.1-2-mingw32-dev
libexpat-2.0.1-1-mingw32-dll-1
libgcc-4.6.2-1-mingw32-dll-1
libgettextpo-0.18.1.1-2-mingw32-dll-0
libgmp-5.0.1-1-mingw32-dll-10
libiconv-1.14-2-mingw32-dev
libiconv-1.14-2-mingw32-dll-2
libintl-0.18.1.1-2-mingw32-dll-8
libmpc-0.8.1-1-mingw32-dll-2
libmpfr-2.4.1-1-mingw32-dll-1
libstdc++-4.6.2-1-mingw32-dll-6
libz-1.2.7-1-mingw32-dev
libz-1.2.7-1-mingw32-dll-1
mingwrt-3.20-mingw32-dev
mingwrt-3.20-mingw32-dll
pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev
w32api-3.17-2-mingw32-dev

Download libxml2 and iconv
ftp://ftp.zlatkovic.com/libxml/iconv-1.9.2.win32.zip
ftp://ftp.zlatkovic.com/libxml/libxml2-2.7.8.win32.zip

And, at last, download from my site (http://linbox.free.fr/vala)
vala-0.18.0-mingw32-bin.tar.xz (2,5 Mo)
libgee-0.6.5-mingw32.tar.xz (0,5 Mo)
libffi-3.0.11-mingw32-bin.tar.xz (61 Ko)
glib-2.34.0-mingw32-bin.tar.xz (4,1 Mo)
pkg-config-0.27.1-mingw32-bin.tar.xz (64 Ko)

(DONT USE libxml2 FROM MY SITE)

== Decompress into d:\cross-compile\mingw

Move files from d:\cross-compile\mingw\iconv-1.9.2.win32\ to 
d:\cross-compile\mingw
Move files from d:\cross-compile\mingw\libxml2-2.7.8.win32\ to 
d:\cross-compile\mingw
Move files from d:\cross-compile\mingw\mingwin32\ to 
d:\cross-compile\mingw


Ok, now we need to configure some MSYS files

Replace  D:\cross-compile\msys\etc\fstab with these lines
---
D:/cross-compile/mingw /usr/local
d:/cross-compile/src/src
d:/cross-compile/mingw/lib/mingw/lib
---


Edit D:\cross-compile\msys\etc\profile
Replace
---
if [ $MSYSTEM == MINGW32 ]; then
  export PATH=.:/usr/local/bin:/mingw/bin:/bin:$PATH
else
  export PATH=.:/usr/local/bin:/bin:/mingw/bin:$PATH
fi
---
by
---
export PATH=/usr/bin:/bin:/d/utils:/usr/local/bin:.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export C_LIBRARY_PATH=/usr/include:/usr/local/include
export CPLUS_LIBRARY_PATH=/usr/lib:/usr/local/lib
---

Then launch msys.bat

It seems to work but with a long program, which launches, it crashed 
when I tried something... Well I still look .


If you have any information or comments, do not hesitate ... :)

Some errors and how to resolv  :
---
Probleme : (compilation glib en fait)
/bin/sh: line 19: python2.5: command not found
Solution :
export PYTHON=/d/Python2.5/python
---
Probleme :
d:/cross-compile/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o: 
In function `_mingw_CRTStartup': 
C:\MinGW\msys\1.0\src\mingwrt/../mingw/crt1.c:193: undefined reference 
to `__dyn_tls_init_callback'

collect2: ld returned 1 exit status
error: cc exited with status 1
Solution:
Le chemin vers PKG_CONFIG n'es tpas bon...
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig


Regards

Raum

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to compile Vala using MingW under Windows

2012-10-05 Thread raum
Hello,

Thanks but it's not related to libraries declaration under Windows but
how I missed something when I've compiled Vala 0.18... or something
related to PATH

I think I should try to recompile and reinstall...

Thanks

Regards

Raum

 I learned that under Windows you need to provide some extra info about
 libs
 you're using.

 For linux I have this:
 valac -o Game --pkg gee-1.0 --pkg gl --pkg libglfw --pkg glu --pkg
 libxml-2.0 --pkg gio-2.0 \
 ... (other lines, source files mostly)

 For Windows:
 valac -o Game --pkg gee-1.0 --pkg gl --pkg libglfw --pkg glu --pkg
 libxml-2.0 --pkg gio-2.0 \
 -X -lglfw -X -lopengl32 -X -lgee -X -lglu32 -X -lxml2 \
 --cc=gcc \
 ... (other lines, source files mostly)

 I don't remember exactly why I had to specify cc, but as there I have it,
 I
 thought to keep it here as well :)

 I have few other things that work differently on Windows and Linux (so I
 have ifdef here and there) but that might be related to mess I have on
 both
 systems (I tend to update vala quite randomly, same goes for other
 packages
 and those are the results)
 2012/9/29 Luca Bruno lethalma...@gmail.com

 On Fri, Sep 28, 2012 at 10:19 PM, r...@no-log.org wrote:

  Ehm... I need some help :)
 

 Try contacting this guy:
 https://mail.gnome.org/archives/vala-list/2012-September/msg00073.html
 It looks like he managed to get something running up.


  d:/cross-compile/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o:
 In
  function `_mingw_CRTStartup':
  C:\MinGW\msys\1.0\src\mingwrt/../mingw/crt1.c:193: undefined reference
 to
  `__dyn_tls_init_callback'
  collect2: ld returned 1 exit status
  error: cc exited with status 1
 

 That's something related to gcc if I'm not wrong. Before using valac,
 ensure that your gcc is working correctly.

 --
 www.debian.org - The Universal Operating System

 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list




___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to compile Vala using MingW under Windows

2012-10-05 Thread raum
Ok I've found my PKG_CONFIG environnement variable was wrong...

# export PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'
# valac -v -g test4.vala
# test4
Hello

*\o/*

Raum

 Hello,

 Thanks but it's not related to libraries declaration under Windows but
 how I missed something when I've compiled Vala 0.18... or something
 related to PATH

 I think I should try to recompile and reinstall...

 Thanks

 Regards

 Raum

 I learned that under Windows you need to provide some extra info about
 libs
 you're using.

 For linux I have this:
 valac -o Game --pkg gee-1.0 --pkg gl --pkg libglfw --pkg glu --pkg
 libxml-2.0 --pkg gio-2.0 \
 ... (other lines, source files mostly)

 For Windows:
 valac -o Game --pkg gee-1.0 --pkg gl --pkg libglfw --pkg glu --pkg
 libxml-2.0 --pkg gio-2.0 \
 -X -lglfw -X -lopengl32 -X -lgee -X -lglu32 -X -lxml2 \
 --cc=gcc \
 ... (other lines, source files mostly)

 I don't remember exactly why I had to specify cc, but as there I have
 it,
 I
 thought to keep it here as well :)

 I have few other things that work differently on Windows and Linux (so I
 have ifdef here and there) but that might be related to mess I have on
 both
 systems (I tend to update vala quite randomly, same goes for other
 packages
 and those are the results)
 2012/9/29 Luca Bruno lethalma...@gmail.com

 On Fri, Sep 28, 2012 at 10:19 PM, r...@no-log.org wrote:

  Ehm... I need some help :)
 

 Try contacting this guy:
 https://mail.gnome.org/archives/vala-list/2012-September/msg00073.html
 It looks like he managed to get something running up.


  d:/cross-compile/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o:
 In
  function `_mingw_CRTStartup':
  C:\MinGW\msys\1.0\src\mingwrt/../mingw/crt1.c:193: undefined
 reference
 to
  `__dyn_tls_init_callback'
  collect2: ld returned 1 exit status
  error: cc exited with status 1
 

 That's something related to gcc if I'm not wrong. Before using valac,
 ensure that your gcc is working correctly.

 --
 www.debian.org - The Universal Operating System

 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list




 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Packaged installation (gcc 4.6.2, vala 0.18)

2012-10-05 Thread Raum

Well, I'll provide an installation in the following directories :
d:\cross-compile\mingw (linked to /usr/local)
d:\cross-compile\msys (linked to /usr)

At the end of the process, the files will occupied 250 MB

Link to Mingw32 sourceforge : http://sourceforge.net/projects/mingw/files/

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MSYS Installation MSYS

Download the following packages
bash-3.1.17-4-msys-1.0.16-bin
bison-2.4.2-1-msys-1.0.13-bin
coreutils-5.97-3-msys-1.0.13-bin
diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin
findutils-4.4.2-2-msys-1.0.13-bin
flex-2.5.35-2-msys-1.0.13-bin
gawk-3.1.7-2-msys-1.0.13-bin
grep-2.5.4-2-msys-1.0.13-bin
libiconv-1.13.1-2-msys-1.0.13-dll-2
libintl-0.17-2-msys-dll-8
libregex-1.20090805-2-msys-1.0.13-dll-1
libtermcap-0.20050421_1-2-msys-1.0.13-dll-0
m4-1.4.14-1-msys-1.0.13-bin
make-3.81-3-msys-1.0.13-bin
msysCORE-1.0.17-1-msys-1.0.17-bin
msysCORE-1.0.17-1-msys-1.0.17-dev
msysCORE-1.0.17-1-msys-1.0.17-ext
msysCORE-1.0.17-1-msys-1.0.17-ext
patch-2.6.1-1-msys-1.0.13-bin
perl-5.6.1-MSYS-1.0.11
sed-4.2.1-2-msys-1.0.13-bin
tar-1.23-1-msys-1.0.13-bin
termcap-0.20050421_1-2-msys-1.0.13-bin
texinfo-4.13a-2-msys-1.0.13-bin

== decompress into d:\cross-compile\msys

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MingW and Vala installation

Download from MingW32 :
binutils-2.22-1-mingw32-bin
gcc-c++-4.6.2-1-mingw32-bin
gcc-core-4.6.2-1-mingw32-bin
gettext-0.18.1.1-2-mingw32-bin
gettext-0.18.1.1-2-mingw32-dev
libexpat-2.0.1-1-mingw32-dll-1
libgcc-4.6.2-1-mingw32-dll-1
libgettextpo-0.18.1.1-2-mingw32-dll-0
libgmp-5.0.1-1-mingw32-dll-10
libiconv-1.14-2-mingw32-dev
libiconv-1.14-2-mingw32-dll-2
libintl-0.18.1.1-2-mingw32-dll-8
libmpc-0.8.1-1-mingw32-dll-2
libmpfr-2.4.1-1-mingw32-dll-1
libstdc++-4.6.2-1-mingw32-dll-6
libz-1.2.7-1-mingw32-dev
libz-1.2.7-1-mingw32-dll-1
mingwrt-3.20-mingw32-dev
mingwrt-3.20-mingw32-dll
pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev
w32api-3.17-2-mingw32-dev

Download libxml2 and iconv
ftp://ftp.zlatkovic.com/libxml/iconv-1.9.2.win32.zip
ftp://ftp.zlatkovic.com/libxml/libxml2-2.7.8.win32.zip

And, at last, download from my site (http://linbox.free.fr/vala)
vala-0.18.0-mingw32-bin.tar.xz (2,5 Mo)
libgee-0.6.5-mingw32.tar.xz (0,5 Mo)
libffi-3.0.11-mingw32-bin.tar.xz (61 Ko)
glib-2.34.0-mingw32-bin.tar.xz (4,1 Mo)
pkg-config-0.27.1-mingw32-bin.tar.xz (64 Ko)

(DONT USE libxml2 FROM MY SITE)

== Decompress into d:\cross-compile\mingw

Move files from d:\cross-compile\mingw\iconv-1.9.2.win32\ to 
d:\cross-compile\mingw
Move files from d:\cross-compile\mingw\libxml2-2.7.8.win32\ to 
d:\cross-compile\mingw
Move files from d:\cross-compile\mingw\mingwin32\ to 
d:\cross-compile\mingw


Ok, now we need to configure some MSYS files

Replace  D:\cross-compile\msys\etc\fstab with these lines
---
D:/cross-compile/mingw /usr/local
d:/cross-compile/src/src
d:/cross-compile/mingw/lib/mingw/lib
---


Edit D:\cross-compile\msys\etc\profile
Replace
---
if [ $MSYSTEM == MINGW32 ]; then
  export PATH=.:/usr/local/bin:/mingw/bin:/bin:$PATH
else
  export PATH=.:/usr/local/bin:/bin:/mingw/bin:$PATH
fi
---
by
---
export PATH=/usr/bin:/bin:/d/utils:/usr/local/bin:.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export C_LIBRARY_PATH=/usr/include:/usr/local/include
export CPLUS_LIBRARY_PATH=/usr/lib:/usr/local/lib
---

Then launch msys.bat

It seems to work but with a long program, which launches, it crashed 
when I tried something... Well I still look .


If you have any information or comments, do not hesitate ... :)

Some errors and how to resolv  :
---
Probleme : (compilation glib en fait)
/bin/sh: line 19: python2.5: command not found
Solution :
export PYTHON=/d/Python2.5/python
---
Probleme :
d:/cross-compile/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o: In 
function `_mingw_CRTStartup': 
C:\MinGW\msys\1.0\src\mingwrt/../mingw/crt1.c:193: undefined reference 
to `__dyn_tls_init_callback'

collect2: ld returned 1 exit status
error: cc exited with status 1
Solution:
Le chemin vers PKG_CONFIG n'es tpas bon...
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig


Regards

Raum

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to compile glib using MingW under Windows

2012-09-28 Thread raum
Well... i've installed python 2.5 and set PYTHON variable before ./configure

On MSYS console (I've installed python in d:\utils\python25)

# export PYTHON=/d/utils/Python25/python
# export LIBFFI_CFLAGS='-I /mingw/lib/libffi-3.0.11/include'
# export LIBFFI_LIBS=-lffi
# export CFLAGS=-O0 -g -pipe -Wall -march=i686 -mms-bitfields -mthreads
./configure --prefix=/build --with-pcre=internal --enable-silent-rules
--disable-modular-tests
# make
# make install

and it's ok...

Regards

Raum

ps: I'm preparing packages for vala 0.18.0, glib 2.34, libgee, libxml2. :)

 Hi,

 I didn't see this error before  Do you have any idea to correct this ?
 (installing python2.5 did not resolv this problem)

 --
 USER@POSTE /src/glib-2.34.0
 $ make install
 Making install in .
 make[1]: Entering directory `/src/glib-2.34.0'
 make[2]: Entering directory `/src/glib-2.34.0'
 [...]
 make[4]: Entering directory `/src/glib-2.34.0/gio/gdbus-2.0/codegen'
  /usr/bin/mkdir -p '/build/bin'
  /usr/bin/install -c gdbus-codegen '/build/bin'
  /usr/bin/mkdir -p '/build/lib/gdbus-2.0/codegen'
  /usr/bin/install -c -m 644 __init__.py codegen.py codegen_main.py
 codegen_docbo
 ok.py config.py dbustypes.py parser.py utils.py
 '/build/lib/gdbus-2.0/codegen'
 /bin/sh: line 19: python2.5: command not found
 make[4]: *** [install-codegenPYTHON] Error 127
 make[4]: Leaving directory `/src/glib-2.34.0/gio/gdbus-2.0/codegen'
 make[3]: *** [install-am] Error 2
 make[3]: Leaving directory `/src/glib-2.34.0/gio/gdbus-2.0/codegen'
 make[2]: *** [install-recursive] Error 1
 make[2]: Leaving directory `/src/glib-2.34.0/gio'
 make[1]: *** [install] Error 2
 make[1]: Leaving directory `/src/glib-2.34.0/gio'
 make: *** [install-recursive] Error 1
 --

 If I install python 2.5, i've got something like pythoon can't find
 sh...

 Thanks

 regards


 In fact, I've got Hello,

 I've tried to compile libgee but it depends to glib... :-/

 So, how to compile glib for Vala ?!?

 Reference site : http://www.mingw.org/wiki/Bootstrapping_GLIB_with_MinGW

 For information, I've relocated my precdedent vala-src directory in
 /src directory. I've modified msys/etc/fstab to :
 c:/vala-build/mingw  /mingw
 c:/vala-build/vala-0.18  /vala
 c:/vala-build/src /src
 c:/vala-build/mingw/lib  /usr/lib
 c:/vala-build/build /build

 1/ Install few more libs

 At first, we need to install these packages :
 libstdc++-4.6.2-1-mingw32-dll-6.tar.lzma
 libgcc-4.6.2-1-mingw32-dll-1.tar.lzma (for libgcc_s_dw2-1.dll)
 mmingwrt-3.20-mingw32-dev.tar.gz (for  crt2.o)
 libz-1.2.7-1-mingw32-dev.tar.lzma
 libz-1.2.7-1-mingw32-dll-1.tar.lzma
 gettext-0.18.1.1-2-mingw32-dev.tar.lzma
 gettext-0.18.1.1-2-mingw32-bin.tar.lzma
 libgettextpo-0.18.1.1-2-mingw32-dll-0.tar.lzma (for
 libgettextsrc-0-18-1.dll)
 libexpat-2.0.1-1-mingw32-dll-1.tar.gz

 (some links :
 http://sourceforge.net/projects/mingw/files/MinGW/Extension/zlib/zlib-1.2.7-1/libz-1.2.7-1-mingw32-dev.tar.lzma/download
 http://sourceforge.net/projects/mingw/files/MinGW/Extension/zlib/zlib-1.2.7-1/libz-1.2.7-1-mingw32-dll-1.tar.lzma/download

 http://sourceforge.net/projects/mingw/files/MinGW/Base/gettext/gettext-0.18.1.1-2/gettext-0.18.1.1-2-mingw32-dev.tar.lzma/download
 http://sourceforge.net/projects/mingw/files/MinGW/Base/gettext/gettext-0.18.1.1-2/gettext-0.18.1.1-2-mingw32-bin.tar.lzma/download
 http://sourceforge.net/projects/mingw/files/MinGW/Base/gettext/gettext-0.18.1.1-2/libgettextpo-0.18.1.1-2-mingw32-dll-0.tar.lzma/download
 )

 2/ Compile  install FFI lib from tarball

 And glib need libffi, so we need to download libffi package.

 FFI stands for Foreign Function Interface. A foreign function interface
 is the popular name for the interface that allows code written in one
 language to call code written in another language.

 Link : ftp://sourceware.org/pub/libffi/libffi-3.0.11.tar.gz
 (alt link:
 http://ftp.gwdg.de/pub/linux/sources.redhat.com/libffi/libffi-3.0.11.tar.gz)


 # cd /src/libffi-3.0.11/
 # ./configure --prefix=/build
 # make
 # make install

 Then move files into c:/vala-build/mingw.

 3/ Compile  install glib

 Download lastest release and extract to c:/vala-build/:
 http://ftp.gnome.org/pub/GNOME/sources/glib/2.34/glib-2.34.0.tar.xz

 And now :

 # cd /src/glib-2.34.0

 // I don't want to use pkg-config for libffi
 /src/glib-2.34.0# export LIBFFI_CFLAGS='-I
 /mingw/lib/libffi-3.0.11/include'
 /src/glib-2.34.0# export LIBFFI_LIBS=-lffi
 /src/glib-2.34.0# export CFLAGS=-O0 -g -pipe -Wall -march=i686
 -mms-bitfields -mthreads
 /src/glib-2.34.0# ./configure --prefix=/build --with-pcre=internal
 --enable-silent-rules --disable-modular-tests --disable-static

 (perhaps we need these variables...not sure)
 export CPPFLAGS=-DG_ATOMIC_OP_USE_GCC_BUILTINS=1
 export LDFLAGS=-Wl,--enable-auto-image-base
 export lt_cv_deplibs_check_method=pass_all
 ()


 /src/glib-2.34.0# make

 /src/glib-2.34.0# make install

 And that's

Re: [Vala] How to compile Vala using MingW under Windows

2012-09-28 Thread raum
Hello

In fact, I've got a problem using Vala0.18 I compiled... I've created a
test file :
-
void main() {
stdout.printf (hello world\r\n);
}


L:\gcc --version
gcc (GCC) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


L:\valac --version
Vala 0.18.0

L:\set
(...)
CC=gcc
Path=C:\WINDOWS\system32;C:\WINDOWS;d:\cross-compile\vala-0.18.0\bin;d:\cross-compile\mingw\bin;d:\utils\;d:\utils\php\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.wlua;.lexe
PKG_CONFIG_PATH=D:\cross-compile\vala-0.18.0\lib\pkgconfig
(...)

L:\valac test.vala
error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
such file or directory)
error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
such file or directory)
error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
such file or directory)
Compilation failed: 3 error(s), 0 warning(s)

L:

(== error: Failed to execute child process (No such file or directory))

Ehm, do you have any clue to solve this problem ?! Did I break the
compilator when trying to compile with Mingw ?

Thanks

Raum

 Hi,

 Feel free to help me to improve (or correct ;-) ) this mini how-to and
 report if something doesn't work.

 Next step, I think I'll try to bundle clang... :-?

 Thanks

 Raum


 (...)

 I think I've successed to compile vala 0.18 under Windows. You could have
 a look to my page (tarball available for testing) :
 http://linbox.free.fr/vala


 Here it is :
 --
 How to compile Vala under Windows
 --

 # First step :
 c:\ mkdir vala-build
 c:\ cd vala-build
 c:\vala-build mkdir vala
 c:\vala-build mkdir vala-src
 c:\vala-build mkdir mingw
 c:\vala-build mkdir msys
 c:\vala-build mkdir build

 (...)
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to compile Vala using MingW under Windows

2012-09-28 Thread raum
Well... I've compiled and installed pkg-config-0.27.1 and it seems it's ok...

L:\valac test.vala

L:\test
hello world

Sorry to have disturbed you for not much.. ^__^

Regards

Raum

ps: I'll prepare some packages to download in next hours...
glib-2.34.0-mingw32-bin.tar.xz
libffi-3.0.11-mingw32-bin.tar.xz
libgee-0.6.5-mingw32.tar.xz
libxml2-2.6.30-mingw32-dll.tar.xz
pkg-config-0.27.1-mingw32-bin.tar.xz
vala-0.18.0-mingw32-bin.tar.xz

Do you think I (we) need other things ?

 Hello

 In fact, I've got a problem using Vala0.18 I compiled... I've created a
 test file :
 -
 void main() {
   stdout.printf (hello world\r\n);
 }
 

 L:\gcc --version
 gcc (GCC) 4.6.2
 Copyright (C) 2011 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.


 L:\valac --version
 Vala 0.18.0

 L:\set
 (...)
 CC=gcc
 Path=C:\WINDOWS\system32;C:\WINDOWS;d:\cross-compile\vala-0.18.0\bin;d:\cross-compile\mingw\bin;d:\utils\;d:\utils\php\
 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.wlua;.lexe
 PKG_CONFIG_PATH=D:\cross-compile\vala-0.18.0\lib\pkgconfig
 (...)

 L:\valac test.vala
 error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
 such file or directory)
 error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
 such file or directory)
 error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
 such file or directory)
 Compilation failed: 3 error(s), 0 warning(s)

 L:

 (== error: Failed to execute child process (No such file or directory))

 Ehm, do you have any clue to solve this problem ?! Did I break the
 compilator when trying to compile with Mingw ?

 Thanks

 Raum

 Hi,

 Feel free to help me to improve (or correct ;-) ) this mini how-to and
 report if something doesn't work.

 Next step, I think I'll try to bundle clang... :-?

 Thanks

 Raum


 (...)

 I think I've successed to compile vala 0.18 under Windows. You could
 have
 a look to my page (tarball available for testing) :
 http://linbox.free.fr/vala


 Here it is :
 --
 How to compile Vala under Windows
 --

 # First step :
 c:\ mkdir vala-build
 c:\ cd vala-build
 c:\vala-build mkdir vala
 c:\vala-build mkdir vala-src
 c:\vala-build mkdir mingw
 c:\vala-build mkdir msys
 c:\vala-build mkdir build

 (...)
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to compile Vala using MingW under Windows

2012-09-28 Thread raum
Ehm... I need some help :)

I've extracted mingw base and msys.

I use packages I've compiled (check http://linbox.free.fr/vala) and
extracted them as follow :
d:\cross-compile\mingw
   libffi-3.0.11-mingw32-bin.tar.xz
   glib-2.34.0-mingw32-bin.tar.xz
   pkg-config-0.27.1-mingw32-bin.tar.xz

d:\cross-compile\vala
   vala-0.18.0-mingw32-bin.tar.xz
   libgee-0.6.5-mingw32.tar.xz
   libxml2-2.6.30-mingw32-dll.tar.xz

d:\cross-compile\msys


$ mount
(...)
D:\cross-compile\mingw\lib on /usr/lib type user (binmode)
D:\cross-compile\build on /build type user (binmode)
D:\cross-compile\mingw on /mingw type user (binmode)
D:\cross-compile\msys on /usr type user (binmode,noumount)
D:\cross-compile\msys on / type user (binmode,noumount)
D:\cross-compile\vala on /vala type user (binmode)
d:\cross-compile\src on /src type user (binmode)
(...)

$ gcc --version
gcc.exe (GCC) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ valac --version
Vala 0.18.0

$ cat test.vala
using Xml;

void main() {

}

$ valac --pkg libxml-2.0 -X -llibxml2 --disable-warnings test.vala
D:\cross-compile\mingw\bin/ld.exe: cannot find -llibxml2
collect2: ld returned 1 exit status
error: cc exited with status 1
Compilation failed: 1 error(s), 0 warning(s)

$ valac -X -L/vala/lib --pkg libxml-2.0 -X -llibxml2 --disable-warnings
test.vala
d:/cross-compile/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o: In
function `_mingw_CRTStartup':
C:\MinGW\msys\1.0\src\mingwrt/../mingw/crt1.c:193: undefined reference to
`__dyn_tls_init_callback'
collect2: ld returned 1 exit status
error: cc exited with status 1
Compilation failed: 1 error(s), 0 warning(s)

And at last, I could get errors from libxml/tree.h not found

Do you have some advices ?

Thanks

Raum

 Well... I've compiled and installed pkg-config-0.27.1 and it seems it's
 ok...

 L:\valac test.vala

 L:\test
 hello world

 Sorry to have disturbed you for not much.. ^__^

 Regards

 Raum

 ps: I'll prepare some packages to download in next hours...
 glib-2.34.0-mingw32-bin.tar.xz
 libffi-3.0.11-mingw32-bin.tar.xz
 libgee-0.6.5-mingw32.tar.xz
 libxml2-2.6.30-mingw32-dll.tar.xz
 pkg-config-0.27.1-mingw32-bin.tar.xz
 vala-0.18.0-mingw32-bin.tar.xz

 Do you think I (we) need other things ?

 Hello

 In fact, I've got a problem using Vala0.18 I compiled... I've created a
 test file :
 -
 void main() {
  stdout.printf (hello world\r\n);
 }
 

 L:\gcc --version
 gcc (GCC) 4.6.2
 Copyright (C) 2011 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is
 NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.


 L:\valac --version
 Vala 0.18.0

 L:\set
 (...)
 CC=gcc
 Path=C:\WINDOWS\system32;C:\WINDOWS;d:\cross-compile\vala-0.18.0\bin;d:\cross-compile\mingw\bin;d:\utils\;d:\utils\php\
 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.wlua;.lexe
 PKG_CONFIG_PATH=D:\cross-compile\vala-0.18.0\lib\pkgconfig
 (...)

 L:\valac test.vala
 error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
 such file or directory)
 error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
 such file or directory)
 error: L'ex#9500;®cution du processus fils a #9500;®chou#9500;® (No
 such file or directory)
 Compilation failed: 3 error(s), 0 warning(s)

 L:

 (== error: Failed to execute child process (No such file or directory))

 Ehm, do you have any clue to solve this problem ?! Did I break the
 compilator when trying to compile with Mingw ?

 Thanks

 Raum

 Hi,

 Feel free to help me to improve (or correct ;-) ) this mini how-to and
 report if something doesn't work.

 Next step, I think I'll try to bundle clang... :-?

 Thanks

 Raum


 (...)

 I think I've successed to compile vala 0.18 under Windows. You could
 have
 a look to my page (tarball available for testing) :
 http://linbox.free.fr/vala


 Here it is :
 --
 How to compile Vala under Windows
 --

 # First step :
 c:\ mkdir vala-build
 c:\ cd vala-build
 c:\vala-build mkdir vala
 c:\vala-build mkdir vala-src
 c:\vala-build mkdir mingw
 c:\vala-build mkdir msys
 c:\vala-build mkdir build

 (...)
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list



___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] What is traversable and how to use it !!! [since libgee 0.7]

2012-09-27 Thread raum
Ok, so which one ? the traversable thing is implemented since Libgee
0.7.. :-?

And a thing which also irritates me (sorry...), it is to see the
documentation referring now to the version 0.8...
http://valadoc.org/libgee-0.8/index.htm

Thanks

Raum


 On Thu, Sep 27, 2012 at 10:24 AM, r...@no-log.org wrote:

 Hello,

 I've compiled Libgee 0.8 (as usual with MingW under Windows ;)) and now
 when I try to compile my project, I've got an error... =___= (greeeaat)


 Libgee 0.8 is known to break API, you don't have to necessarily upgrade.

 --
 www.debian.org - The Universal Operating System

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to compile Vala using MingW under Windows

2012-09-26 Thread raum
Hi,

Feel free to help me to improve (or correct ;-) ) this mini how-to and
report if something doesn't work.

Next step, I think I'll try to bundle clang... :-?

Thanks

Raum


(...)

I think I've successed to compile vala 0.18 under Windows. You could have
a look to my page (tarball available for testing) :
http://linbox.free.fr/vala


Here it is :
--
How to compile Vala under Windows
--

# First step :
c:\ mkdir vala-build
c:\ cd vala-build
c:\vala-build mkdir vala
c:\vala-build mkdir vala-src
c:\vala-build mkdir mingw
c:\vala-build mkdir msys
c:\vala-build mkdir build

(...)
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to compile glib using MingW under Windows

2012-09-26 Thread raum
Hello,

I've tried to compile libgee but it depends to glib... :-/

So, how to compile glib for Vala ?!?

Reference site : http://www.mingw.org/wiki/Bootstrapping_GLIB_with_MinGW

For information, I've relocated my precdedent vala-src directory in
/src directory. I've modified msys/etc/fstab to :
c:/vala-build/mingw /mingw
c:/vala-build/vala-0.18 /vala
c:/vala-build/src /src
c:/vala-build/mingw/lib /usr/lib
c:/vala-build/build /build

1/ Install few more libs

At first, we need to install these packages :
libstdc++-4.6.2-1-mingw32-dll-6.tar.lzma
libgcc-4.6.2-1-mingw32-dll-1.tar.lzma (for libgcc_s_dw2-1.dll)
mmingwrt-3.20-mingw32-dev.tar.gz (for  crt2.o)
libz-1.2.7-1-mingw32-dev.tar.lzma
libz-1.2.7-1-mingw32-dll-1.tar.lzma
gettext-0.18.1.1-2-mingw32-dev.tar.lzma
gettext-0.18.1.1-2-mingw32-bin.tar.lzma
libgettextpo-0.18.1.1-2-mingw32-dll-0.tar.lzma (for libgettextsrc-0-18-1.dll)
libexpat-2.0.1-1-mingw32-dll-1.tar.gz

(some links :
http://sourceforge.net/projects/mingw/files/MinGW/Extension/zlib/zlib-1.2.7-1/libz-1.2.7-1-mingw32-dev.tar.lzma/download
http://sourceforge.net/projects/mingw/files/MinGW/Extension/zlib/zlib-1.2.7-1/libz-1.2.7-1-mingw32-dll-1.tar.lzma/download

http://sourceforge.net/projects/mingw/files/MinGW/Base/gettext/gettext-0.18.1.1-2/gettext-0.18.1.1-2-mingw32-dev.tar.lzma/download
http://sourceforge.net/projects/mingw/files/MinGW/Base/gettext/gettext-0.18.1.1-2/gettext-0.18.1.1-2-mingw32-bin.tar.lzma/download
http://sourceforge.net/projects/mingw/files/MinGW/Base/gettext/gettext-0.18.1.1-2/libgettextpo-0.18.1.1-2-mingw32-dll-0.tar.lzma/download
)

2/ Compile  install FFI lib from tarball

And glib need libffi, so we need to download libffi package.

FFI stands for Foreign Function Interface. A foreign function interface
is the popular name for the interface that allows code written in one
language to call code written in another language.

Link : ftp://sourceware.org/pub/libffi/libffi-3.0.11.tar.gz
(alt link:
http://ftp.gwdg.de/pub/linux/sources.redhat.com/libffi/libffi-3.0.11.tar.gz)


# cd /src/libffi-3.0.11/
# ./configure --prefix=/build
# make
# make install

Then move files into c:/vala-build/mingw.

3/ Compile  install glib

Download lastest release and extract to c:/vala-build/:
http://ftp.gnome.org/pub/GNOME/sources/glib/2.34/glib-2.34.0.tar.xz

And now :

# cd /src/glib-2.34.0

// I don't want to use pkg-config for libffi
/src/glib-2.34.0# export LIBFFI_CFLAGS='-I /mingw/lib/libffi-3.0.11/include'
/src/glib-2.34.0# export LIBFFI_LIBS=-lffi
/src/glib-2.34.0# export CFLAGS=-O0 -g -pipe -Wall -march=i686
-mms-bitfields -mthreads
/src/glib-2.34.0# ./configure --prefix=/build --with-pcre=internal
--enable-silent-rules --disable-modular-tests --disable-static

(perhaps we need these variables...not sure)
export CPPFLAGS=-DG_ATOMIC_OP_USE_GCC_BUILTINS=1
export LDFLAGS=-Wl,--enable-auto-image-base
export lt_cv_deplibs_check_method=pass_all
()


/src/glib-2.34.0# make

/src/glib-2.34.0# make install

And that's probably all...

Have fun

Regards

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to compile glib using MingW under Windows

2012-09-26 Thread raum
Adjustement

# cd /src/glib-2.34.0/
# export LIBFFI_CFLAGS='-I /mingw/lib/libffi-3.0.11/include'
# export LIBFFI_LIBS=-lffi
# export CFLAGS=-O0 -g -pipe -Wall -march=i686 -mms-bitfields -mthreads
# configure --prefix=/build --disable-modular-tests
# make

 Hello,

 I've tried to compile libgee but it depends to glib... :-/

 So, how to compile glib for Vala ?!?

 Reference site : http://www.mingw.org/wiki/Bootstrapping_GLIB_with_MinGW

 For information, I've relocated my precdedent vala-src directory in
 /src directory. I've modified msys/etc/fstab to :
 c:/vala-build/mingw   /mingw
 c:/vala-build/vala-0.18   /vala
 c:/vala-build/src /src
 c:/vala-build/mingw/lib   /usr/lib
 c:/vala-build/build /build

 1/ Install few more libs

 At first, we need to install these packages :
 libstdc++-4.6.2-1-mingw32-dll-6.tar.lzma
 libgcc-4.6.2-1-mingw32-dll-1.tar.lzma (for libgcc_s_dw2-1.dll)
 mmingwrt-3.20-mingw32-dev.tar.gz (for  crt2.o)
 libz-1.2.7-1-mingw32-dev.tar.lzma
 libz-1.2.7-1-mingw32-dll-1.tar.lzma
 gettext-0.18.1.1-2-mingw32-dev.tar.lzma
 gettext-0.18.1.1-2-mingw32-bin.tar.lzma
 libgettextpo-0.18.1.1-2-mingw32-dll-0.tar.lzma (for
 libgettextsrc-0-18-1.dll)
 libexpat-2.0
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How to compile Vala using MingW under Windows

2012-09-25 Thread raum
Hello,

I think I've successed to compile vala 0.18 under Windows. You could have
a look to my page (tarball available for testing) :
http://linbox.free.fr/vala


Here it is :
--
How to compile Vala under Windows
--

# First step :
c:\ mkdir vala-build
c:\ cd vala-build
c:\vala-build mkdir vala
c:\vala-build mkdir vala-src
c:\vala-build mkdir mingw
c:\vala-build mkdir msys
c:\vala-build mkdir build

c:\vala-build cd mingw

# MingW installation

# From http://sourceforge.net/projects/mingw/files/, these packages
# binutils-2.22-1-mingw32-bin
# gcc-core-4.6.2-1-mingw32-bin
# libgmp-5.0.1-1-mingw32-dll-10
# libiconv-1.14-2-mingw32-dev
# libiconv-1.14-2-mingw32-dll-2
# libintl-0.18.1.1-1-msys-1.0.17-dll-8
# libmpc-0.8.1-1-mingw32-dll-2
# libmpfr-2.4.1-1-mingw32-dll-1
# pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev
# w32api-3.17-2-mingw32-dev

c:\vala-build\mingw wget 
http://sourceforge.net/projects/mingw/files/MinGW/Base/binutils/binutils-2.22/binutils-2.22-1-mingw32-bin.tar.lzma/download
c:\vala-build\mingw wget
http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.6.2-1/gcc-core-4.6.2-1-mingw32-bin.tar.lzma/download
c:\vala-build\mingw wget
http://sourceforge.net/projects/mingw/files/MinGW/Base/gmp/gmp-5.0.1-1/libgmp-5.0.1-1-mingw32-dll-10.tar.lzma/download
c:\vala-build\mingw wget 
http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/libiconv-1.14-2/libiconv-1.14-2-mingw32-dev.tar.lzma/download
c:\vala-build\mingw wget 
http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/libiconv-1.14-2/libiconv-1.14-2-mingw32-dll-2.tar.lzma/download
c:\vala-build\mingw wget
http://sourceforge.net/projects/mingw/files/MSYS/Base/gettext/gettext-0.18.1.1-1/libintl-0.18.1.1-1-msys-1.0.17-dll-8.tar.lzma/download
c:\vala-build\mingw wget
http://sourceforge.net/projects/mingw/files/MinGW/Base/mpc/mpc-0.8.1-1/libmpc-0.8.1-1-mingw32-dll-2.tar.lzma/download
c:\vala-build\mingw wget
http://sourceforge.net/projects/mingw/files/MinGW/Base/mpfr/mpfr-2.4.1-1/libmpfr-2.4.1-1-mingw32-dll-1.tar.lzma/download
c:\vala-build\mingw wget
http://sourceforge.net/projects/mingw/files/MinGW/Base/pthreads-w32/pthreads-w32-2.9.0-pre-20110507-2/pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev.tar.lzma/download
c:\vala-build\mingw wget
http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/w32api-3.17/w32api-3.17-2-mingw32-dev.tar.lzma/download

#Then extract and you should have :
c:\vala-build\mingw dir
bin
include
lib
libexec

c:\vala-build\mingw cd ..\msys

# msysCORE-1.0.17-1-msys-1.0.17-bin.tar.lzma
c:\vala-build\msys wget
http://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.17-1/msysCORE-1.0.17-1-msys-1.0.17-bin.tar.lzma/download

# and extract

c:\vala-build\mingw cd ..\vala-src
c:\vala-build\vala-src

# download lastest release from https://live.gnome.org/Vala/Release and
extract

# download http://vala-win32.googlecode.com/files/vala-0.12.0.exe and
install in c:\vala-build\vala



Ok now we need to adjust msys configuration.

Edit c:\vala-build\msys\etc\fstab to :
C:/vala-build/mingw /mingw
C:/vala-build/vala  /vala
C:/vala-build/vala-src /vala-src
C:/vala-build/mingw/lib /usr/lib
C:/vala-build/build /build

Edit c:\vala-build\msys\etc\profile to :

++ export PATH=/usr/bin:/bin:/usr/local/bin:/vala/bin:/mingw/bin:.

-- if [ $MSYSTEM == MINGW32 ]; then
--   export PATH=.:/usr/local/bin:/mingw/bin:/bin:$PATH
-- else
--   export PATH=.:/usr/local/bin:/bin:/mingw/bin:$PATH
-- fi

And now, just double click on msys.bat

my_machine# cd /vala-src
my_machine:/vala-src# ./configure --prefix=/build --disable-vapigen
(...)
my_machine:/vala-src# make
(...)
my_machine:/vala-src# make install

And that's all... If you want to test your new fresh install, just change
PATH variable.

tips: --disable-vapigen to avoid sys/wait.h fatal error when compiling

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] How compile Vala 0.17.7 under linux for Win32 (cross compile)

2012-09-23 Thread raum
 for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for GMODULE... yes
checking for GTHREAD... yes
checking for xsltproc... :
checking whether make supports nested variables... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libvala.pc
config.status: creating gee/Makefile
config.status: creating ccode/Makefile
config.status: creating vala/Makefile
config.status: creating codegen/Makefile
config.status: creating compiler/Makefile
config.status: creating vapi/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating doc/vala/Makefile
config.status: creating gobject-introspection/Makefile
config.status: creating vapigen/vapigen.pc
config.status: creating vapigen/Makefile
config.status: creating vapigen/vala-gen-introspect/Makefile
config.status: creating vapigen/vala-gen-introspect/vala-gen-introspect
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

/vala make
make  all-recursive
make[1]: entrant dans le répertoire « /compil/vala »
Making all in gee
make[2]: entrant dans le répertoire « /compil/vala/gee »
make  all-am
make[3]: entrant dans le répertoire « /compil/vala/gee »
make[3]: Rien à faire pour « all-am ».
make[3]: quittant le répertoire « /compil/vala/gee »
make[2]: quittant le répertoire « /compil/vala/gee »
Making all in ccode
make[2]: entrant dans le répertoire « /compil/vala/ccode »
make  all-am
make[3]: entrant dans le répertoire « /compil/vala/ccode »
make[3]: Rien à faire pour « all-am ».
make[3]: quittant le répertoire « /compil/vala/ccode »
make[2]: quittant le répertoire « /compil/vala/ccode »
Making all in vala
make[2]: entrant dans le répertoire « /compil/vala/vala »
make  all-am
make[3]: entrant dans le répertoire « /compil/vala/vala »
  CC valacodecontext.lo
In file included from /usr/include/glib-2.0/glib.h:108:0,
 from valacodecontext.c:26:
/usr/include/glib-2.0/glib/deprecated/gthread.h:123:21: fatal error:
pthread.h: No such file or directory
compilation terminated.
make[3]: *** [valacodecontext.lo] Erreur 1
make[3]: quittant le répertoire « /compil/vala/vala »
make[2]: *** [all] Erreur 2
make[2]: quittant le répertoire « /compil/vala/vala »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /compil/vala »
make: *** [all] Erreur 2

Do you have some hints ?? :)

Thanks

Raum
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] undefined reference to 'SDL_Init' and/or 'WinMain@16' (under Windows)

2012-03-20 Thread Raum
Ehm, perhaps I can't use Visual Studio dependencies with MinGW.

I've downloaded these packages :
http://www.libsdl.org/release/SDL-devel-1.2.15-VC.zip

Perhaps I should download (gasp, =__= I didnt notice..)
http://www.libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz

I'll try and keep you informed ;) (I need to clean my vala install..)

, Hi

 On Mon, Mar 19, 2012 at 3:06 PM,  r...@no-log.org wrote:
 Well, I've corrected my command line with -X option :
 ---
valac --pkg sdl -X -lsdl test2.vala
 c:/vala-0.12.0/lib/libmingw32.a(main.o):main.c:(.text+0xbd): undefined
 reference to `WinMain@16'
 collect2: ld returned 1 exit status
 error: cc exited with status 1
 Compilation failed: 1 error(s), 0 warning(s)
 -

 So I've linked my code with sdl library but I've got the last error
 undefined reference to `WinMain@16' for libmingw32.a

 Any advice ? :)

 Thanks

 Hi,

 I'm testing Vala and I think I didn't understand how to use package
 with
 it... I want to use SDL and SDLNet but I've got an undefined
 reference...

 Here is my test program :
 
 using GLib;
 using SDL;

 int main (string[] args) {
     SDL.init( 0 );

     SDL.quit( );
     stdout.printf (Hello world!);
     return 0;
 }
 

 My command line to compile :
 -
valac --pkg sdl test.vala
 (...)\LOCALS~1\Temp/cconhiY1.o:test.vala.c:(.text+0x15): undefined
 reference to `SDL_Init'
 (...)\LOCALS~1\Temp/cconhiY1.o:test.vala.c:(.text+0x1a): undefined
 reference to `SDL_Quit'
 c:/vala-0.12.0/lib/libmingw32.a(main.o):main.c:(.text+0xbd): undefined
 reference to `WinMain@16'
 collect2: ld returned 1 exit status
 error: cc exited with status 1
 Compilation failed: 1 error(s), 0 warning(s)
 

 But this sample below just compile without any error with the same
 command
 line :
 --
 using GLib;
 using SDL;

 int main (string[] args) {
    stdout.printf (Hello world!);
    return 0;
 }
 --

 Result :
 ---
valac --pkg sdl test2.vala

test2
 Hello world!
 --

 Where am i wrong ?

 Thanks !

 I forget the exact magic needed for mingw, maybe you need to add -X
 -mwindows to the command line?

 If not, add --verbose to your vala commandline and post the full gcc
 commandline that's being used, that may be useful

 Sam


___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] undefined reference to 'SDL_Init' and/or 'WinMain@16' (under Windows)

2012-03-20 Thread Raum
Well, I've tried but I've got the same error.

SDL package : SDL-devel-1.2.15-mingw32.tar.gz
(copy files from tarball to directories include, lib and bin).

To correct a -lcom32dlg error, I've installed :
http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/w32api-3.17/w32api-3.17-1-mingw32-dev.tar.lzma/download
(copy files from tarball to directories include, lib and bin).

valac  --pkg sdl -X -lsdl -X -lsdlmain -X -lmingw32 -X -mwindows
--verbose test2.vala
gcc -o 'C:/vala\test2' 'C:/vala/test2.vala.c' -mms-bitfields
-Ic:/vala/include/glib-2.0 -Ic:/vala/lib/glib-2.0/include  -Lc:/vala/lib
-lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lintl '-lsdl' '-lsdlmain'
'-lmingw32' '-mwindows'
c:/vala/lib/libmingw32.a(main.o):main.c:(.text+0xbd): undefined reference
to `WinMain@16'
collect2: ld returned 1 exit status
error: cc exited with status 1
Compilation failed: 1 error(s), 0 warning(s)

:-?

Thanks :)


 Hello,

 2012/3/20  r...@no-log.org:
 Perhaps a basic linkage error but I dont know how to correct :D

 You should be looking at the SDL FAQ for Windows:
 http://wiki.libsdl.org/moin.cgi/FAQWindows

 For example this question seems to be exactly what you want (don't
 forget -X before each argument):

 I get Undefined reference to 'WinMain@16'
 Under Visual C++, you need to link with SDLmain.lib. Under the gcc
 build environments including Dev-C++, you need to link with the output
 of sdl-config --libs, which is usually: -lmingw32 -lSDLmain -lSDL
 -mwindows


___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] undefined reference to 'SDL_Init' and/or 'WinMain@16' (under Windows)

2012-03-20 Thread Raum
Ehm.. I don't have any idea or any clue

I've tried to create C code and compile it :
-
/* test2.c generated by valac 0.12.0, the Vala compiler
 * generated from test2.vala, do not modify */
#include glib.h
#include glib-object.h
#include stdlib.h
#include string.h
#include SDL.h
#include stdio.h

gint _vala_main (gchar** argc, int argc_length1);

gint _vala_main (gchar** argc, int argc_length1) {
gint result = 0;
SDL_Init ((guint32) 0);
SDL_Quit ();
fprintf (stdout, Hello world!);
result = 0;
return result;
}

int main (int argc, char ** argv) {
g_type_init ();
return _vala_main (argv, argc);
}
-

And I've got the same error (which is not surprising...) :
gcc -o C:/vala\test2 C:/vala/test2.vala.c -mms-bitfields
-Ic:/vala/include/glib-2.0 -Ic:/vala/lib/glib-2.0/include  -Lc:/vala/lib
-lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lintl -lSDL -lSDLmain -lmingw32
-mwindows
c:/vala/lib/libmingw32.a(main.o):main.c:(.text+0xbd): undefined reference
to `WinMain@16'
collect2: ld returned 1 exit status


 Hello,

 2012/3/20  r...@no-log.org:
 Perhaps a basic linkage error but I dont know how to correct :D

 You should be looking at the SDL FAQ for Windows:
 http://wiki.libsdl.org/moin.cgi/FAQWindows

 For example this question seems to be exactly what you want (don't
 forget -X before each argument):

 I get Undefined reference to 'WinMain@16'
 Under Visual C++, you need to link with SDLmain.lib. Under the gcc
 build environments including Dev-C++, you need to link with the output
 of sdl-config --libs, which is usually: -lmingw32 -lSDLmain -lSDL
 -mwindows


___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] undefined reference to 'SDL_Init' and/or 'WinMain@16' (under Windows)

2012-03-20 Thread Raum
Really strange...

This code below is correct and a window appears !
==
using GLib;
using SDL;

int WinMain(string[] argc)
{
SDL.Surface *screen;

if( SDL.init( InitFlag.VIDEO )  0 )
{
stdout.printf( Impossible d'initialiser SDL:  %s\n,
SDL.get_error( ) );
return 1;
}


screen = SDL.Screen.set_video_mode( 640, 480, 16,
SurfaceFlag.HWSURFACE );
SDL.WindowManager.set_caption (Vala SDL Demo, );

if( screen == null )
{
stdout.printf( Impossible d'initialiser le mode video: %s\n,
SDL.get_error( ) );
return 1;
}

SDL.Timer.delay( 3000 );
SDL.quit();
return 0;
}


int main(string[] argc )
{
stdout.printf (not printed\n);

return 0;
}
=

The main function is not called and I've got two warnings :
Compilation time :
test2.vala:5.1-5.11: warning: method `WinMain' never used
int WinMain(string[] argc)

Linking time :
Warning: resolving _WinMain@16 by linking to _WinMain

I need to have these two function main and winmain... :-?

Ehm...

Thanks


 Hi
 WinMain usually is the entry point for Win32 programs (isntead of
 main()). If you do not have such a function defined in your C-Code you
 get the
 the error message you described. At least that's the experience I have
 with that error message with pure C an WinAPI

 regards
 andi



 Am 20.03.2012 12:06, schrieb r...@no-log.org:
 Ehm.. I don't have any idea or any clue

 I've tried to create C code and compile it :
 -
 /* test2.c generated by valac 0.12.0, the Vala compiler
   * generated from test2.vala, do not modify */
 #includeglib.h
 #includeglib-object.h
 #includestdlib.h
 #includestring.h
 #includeSDL.h
 #includestdio.h

 gint _vala_main (gchar** argc, int argc_length1);

 gint _vala_main (gchar** argc, int argc_length1) {
  gint result = 0;
  SDL_Init ((guint32) 0);
  SDL_Quit ();
  fprintf (stdout, Hello world!);
  result = 0;
  return result;
 }

 int main (int argc, char ** argv) {
  g_type_init ();
  return _vala_main (argv, argc);
 }
 -

 And I've got the same error (which is not surprising...) :
 gcc -o C:/vala\test2 C:/vala/test2.vala.c -mms-bitfields
 -Ic:/vala/include/glib-2.0 -Ic:/vala/lib/glib-2.0/include  -Lc:/vala/lib
 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lintl -lSDL -lSDLmain -lmingw32
 -mwindows
 c:/vala/lib/libmingw32.a(main.o):main.c:(.text+0xbd): undefined
 reference
 to `WinMain@16'
 collect2: ld returned 1 exit status


 Hello,

 2012/3/20r...@no-log.org:
 Perhaps a basic linkage error but I dont know how to correct :D
 You should be looking at the SDL FAQ for Windows:
 http://wiki.libsdl.org/moin.cgi/FAQWindows

 For example this question seems to be exactly what you want (don't
 forget -X before each argument):

 I get Undefined reference to 'WinMain@16'
 Under Visual C++, you need to link with SDLmain.lib. Under the gcc
 build environments including Dev-C++, you need to link with the output
 of sdl-config --libs, which is usually: -lmingw32 -lSDLmain -lSDL
 -mwindows

 ___
 vala-list mailing list
 vala-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/vala-list



___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] undefined reference to 'SDL_Init' and/or 'WinMain@16' (under Windows)

2012-03-19 Thread Raum
Hi,

I'm testing Vala and I think I didn't understand how to use package with
it... I want to use SDL and SDLNet but I've got an undefined
reference...

Here is my test program :

using GLib;
using SDL;

int main (string[] args) {
SDL.init( 0 );

SDL.quit( );
stdout.printf (Hello world!);
return 0;
}


My command line to compile :
-
valac --pkg sdl test.vala
(...)\LOCALS~1\Temp/cconhiY1.o:test.vala.c:(.text+0x15): undefined
reference to `SDL_Init'
(...)\LOCALS~1\Temp/cconhiY1.o:test.vala.c:(.text+0x1a): undefined
reference to `SDL_Quit'
c:/vala-0.12.0/lib/libmingw32.a(main.o):main.c:(.text+0xbd): undefined
reference to `WinMain@16'
collect2: ld returned 1 exit status
error: cc exited with status 1
Compilation failed: 1 error(s), 0 warning(s)


But this sample below just compile without any error with the same command
line :
--
using GLib;
using SDL;

int main (string[] args) {
   stdout.printf (Hello world!);
   return 0;
}
--

Result :
---
valac --pkg sdl test2.vala

test2
Hello world!
--

Where am i wrong ?

Thanks !

Regards

Raum


___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list