Re: [Vala] [Solved] Problem using Mysql in Vala (Fedora 21): /usr/bin/ld: cannot find -lmysqlclient

2014-12-12 Thread AxP

Hello folks,

thanks again for your input! I think I solved the problem! I'm new to 
Vala so I didn't think too much about searching for C tutorials and 
help-documents but after a little "groceries pause" I thought of looking 
after how *.so actually work with gcc. Should have done that before but 
looking on the bright side I now know that its not that bad to use this 
list :P


So, the solution was:

Compiling: valac -c --pkg mysql "%f"
Building: valac --pkg mysql "%f" -X -L/usr/lib64/mysql -X -lmysqlclient

I /think/ I tried using -L before but it seems I made some mistake.

After the build of the snippet worked I tried to build the complete 
example and it actually worked! /But/ I got some minor notice:
valac --pkg mysql "main.vala" -X -L/usr/lib64/mysql -X -lmysqlclient 
(im Verzeichnis: /home/axp/Dokumente/Workspaces/10 Vala/MailServer/src)
/mnt/0AD4B7C55DDA55C5/Daten/Workspaces/10 
Vala/MailServer/src/main.vala.c: In Funktion »_vala_main«:
/mnt/0AD4B7C55DDA55C5/Daten/Workspaces/10 
Vala/MailServer/src/main.vala.c:135:10: Warnung: Zuweisung erzeugt 
Ganzzahl von Zeiger ohne Typkonvertierung
  _tmp13_ = mysql_real_connect (_tmp5_, _tmp6_, _tmp7_, _tmp8_, 
_tmp9_, (guint) _tmp10_, _tmp11_, _tmp12_);

  ^
Kompilierung erfolgreich beendet.
Doesn't seem to hurt :| Probably some of these c-compiler warnings you 
should ignore, right?


So I tried the program and got:
ERROR 2003: Connection failed: Can't connect to MySQL server on 
'127.0.0.1' (111 "Connection refused")
Very nice! The program is semi-working! Now I have to figure some 
SQL-Stuff out, but that should be possible ;)



Thanks again! I will probably write again some time with something more 
interesting!


AxP


Am 12.12.2014 um 19:22 schrieb Steven Oliver:


Steven N. Oliver

On Fri, Dec 12, 2014 at 11:59 AM, AxP > wrote:


Thanks for the answers!

@ Steven Oliver: Am I correct when I say that this solution helps
to find missing header files? I think that they are already
correctly found and the problem lies with the .so file which is
not found.


Yes. My bad.


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


Re: [Vala] Problem using Mysql in Vala (Fedora 21): /usr/bin/ld: cannot find -lmysqlclient

2014-12-12 Thread Steven Oliver
Steven N. Oliver

On Fri, Dec 12, 2014 at 11:59 AM, AxP  wrote:
>
>  Thanks for the answers!
>
> @ Steven Oliver: Am I correct when I say that this solution helps to find
> missing header files? I think that they are already correctly found and the
> problem lies with the .so file which is not found.
>

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


Re: [Vala] Problem using Mysql in Vala (Fedora 21): /usr/bin/ld: cannot find -lmysqlclient

2014-12-12 Thread AxP

Thanks for the answers!

@ Steven Oliver: Am I correct when I say that this solution helps to 
find missing header files? I think that they are already correctly found 
and the problem lies with the .so file which is not found.


@ Tarnyko: I actually searched for this file before and found it in the 
//usr/lib64/mysql/ which is also shown when I use mysql_config. So this 
file is /there/ but ... How would I tell valac where the file is?



This kind of stuff can be a pain.

Very true :D


Am 12.12.2014 um 17:29 schrieb Steven Oliver:
This kind of stuff can be a pain. I've found that I sometimes have to 
update my c_include_path to include the new shared libraries. 
Something like this:


export C_INCLUDE_PATH="/usr/include/libev"

Steven N. Oliver

On Fri, Dec 12, 2014 at 10:41 AM, Tarnyko > wrote:


Hi AxP,
What the message is really telling you, is that you miss the
"libmysqlclient.so" file.
This file is typically in a separate package, depending on the
distribution you are using ; in OpenSUSE for instance, it's in
"libmysqlclient-devel"
(http://rpmfind.net/linux/rpm2html/search.php?query=libmysqlclient-devel)

Hope this helps.
Regards,
Tarnyko
AxP writes:

Hello,
I tried to use MySQL today with Vala but ran into some
Problems. I searched for some solutions but couldn't fix the
issue. I saw a few threads on the list with a similar problem
but it didn't help me.
First I was trying to get
http://www.fromdual.com/mysql-vala-program-example working,
now it's only this short snippet:

using Mysql;
static int main(string[] args) {
Database mysql = new Mysql.Database();
return 0;
}


Problem is that I get this message in return:

valac "main.vala" --pkg mysql -X -lmysqlclient (im
Verzeichnis: /home/axp/Dokumente/Workspaces/10
Vala/MailServer/src)
main.vala:5.14-5.41: warning: local variable `mysql'
declared but never used
Database mysql = new Mysql.Database();
 
/usr/bin/ld: cannot find -lmysqlclient
collect2: Fehler: ld gab 1 als Ende-Status zurück
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)
Kompilierung fehlgeschlagen.


I think that there could be problem with my setup. I've done:

yum install mysql-server
yum install mysql-devel

So the libraries and headers are installed and new.
Compilation with valac -c "%f" --pkg mysql -X -lmysqlclient is
working.
But really creating the little program with valac "%f" --pkg
mysql -X -lmysqlclient fails.
I thought this could be a nice opportunity to try the mailing
list. I hope the problem is not too trivial and I'm the only
one who doesn't know the solution :B
Thank you in advance!
___
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] Problem using Mysql in Vala (Fedora 21): /usr/bin/ld: cannot find -lmysqlclient

2014-12-12 Thread Steven Oliver
This kind of stuff can be a pain. I've found that I sometimes have to
update my c_include_path to include the new shared libraries. Something
like this:

export C_INCLUDE_PATH="/usr/include/libev"

Steven N. Oliver

On Fri, Dec 12, 2014 at 10:41 AM, Tarnyko  wrote:
>
> Hi AxP,
> What the message is really telling you, is that you miss the
> "libmysqlclient.so" file.
> This file is typically in a separate package, depending on the
> distribution you are using ; in OpenSUSE for instance, it's in
> "libmysqlclient-devel" (http://rpmfind.net/linux/
> rpm2html/search.php?query=libmysqlclient-devel)
> Hope this helps.
> Regards,
> Tarnyko
> AxP writes:
>
>> Hello,
>> I tried to use MySQL today with Vala but ran into some Problems. I
>> searched for some solutions but couldn't fix the issue. I saw a few threads
>> on the list with a similar problem but it didn't help me.
>> First I was trying to get http://www.fromdual.com/mysql-
>> vala-program-example working, now it's only this short snippet:
>>
>>> using Mysql;
>>> static int main(string[] args) {
>>> Database mysql = new Mysql.Database();
>>> return 0;
>>> }
>>>
>>
>> Problem is that I get this message in return:
>>
>>> valac "main.vala" --pkg mysql -X -lmysqlclient (im Verzeichnis:
>>> /home/axp/Dokumente/Workspaces/10 Vala/MailServer/src)
>>> main.vala:5.14-5.41: warning: local variable `mysql' declared but never
>>> used
>>> Database mysql = new Mysql.Database();
>>>  
>>> /usr/bin/ld: cannot find -lmysqlclient
>>> collect2: Fehler: ld gab 1 als Ende-Status zurück
>>> error: cc exited with status 256
>>> Compilation failed: 1 error(s), 1 warning(s)
>>> Kompilierung fehlgeschlagen.
>>>
>>
>> I think that there could be problem with my setup. I've done:
>>
>>> yum install mysql-server
>>> yum install mysql-devel
>>>
>> So the libraries and headers are installed and new.
>> Compilation with valac -c "%f" --pkg mysql -X -lmysqlclient is working.
>> But really creating the little program with valac "%f" --pkg mysql -X
>> -lmysqlclient fails.
>> I thought this could be a nice opportunity to try the mailing list. I
>> hope the problem is not too trivial and I'm the only one who doesn't know
>> the solution :B
>> Thank you in advance!
>> ___
>> 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] error: Non-constant field initializers, but the initializer seems constant

2014-12-12 Thread Nicolas CARRIER

> No need to, fixed in master. Nice catch, thanks.

I have backported the patch for our version of vala (0.20.1) and it works like a 
charm.

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


Re: [Vala] Problem using Mysql in Vala (Fedora 21): /usr/bin/ld: cannot find -lmysqlclient

2014-12-12 Thread Tarnyko
Hi AxP, 

What the message is really telling you, is that you miss the 
"libmysqlclient.so" file. 

This file is typically in a separate package, depending on the distribution 
you are using ; in OpenSUSE for instance, it's in "libmysqlclient-devel" 
(http://rpmfind.net/linux/rpm2html/search.php?query=libmysqlclient-devel) 

Hope this helps. 


Regards,
Tarnyko 

AxP writes: 

Hello, 

I tried to use MySQL today with Vala but ran into some Problems. I 
searched for some solutions but couldn't fix the issue. I saw a few 
threads on the list with a similar problem but it didn't help me.
First I was trying to get 
http://www.fromdual.com/mysql-vala-program-example working, now it's only 
this short snippet: 

using Mysql; 

static int main(string[] args) { 

Database mysql = new Mysql.Database(); 


return 0;
}


Problem is that I get this message in return:
valac "main.vala" --pkg mysql -X -lmysqlclient (im Verzeichnis: 
/home/axp/Dokumente/Workspaces/10 Vala/MailServer/src)
main.vala:5.14-5.41: warning: local variable `mysql' declared but never 
used

Database mysql = new Mysql.Database();
 
/usr/bin/ld: cannot find -lmysqlclient
collect2: Fehler: ld gab 1 als Ende-Status zurück
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)
Kompilierung fehlgeschlagen.


I think that there could be problem with my setup. I've done:

yum install mysql-server
yum install mysql-devel
So the libraries and headers are installed and new. 


Compilation with valac -c "%f" --pkg mysql -X -lmysqlclient is working.
But really creating the little program with valac "%f" --pkg mysql -X 
-lmysqlclient fails. 

I thought this could be a nice opportunity to try the mailing list. I hope 
the problem is not too trivial and I'm the only one who doesn't know the 
solution :B

Thank you in advance!
___
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] unused variable warning in generated C code

2014-12-12 Thread Luca Bruno
On 12/12/2014 16:06, Nicolas CARRIER wrote:
>
> Generally speaking, shall I ignore all C warnings if valac issues no
> warning in the vala code himself ?
Yes.

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


Re: [Vala] error: Non-constant field initializers, but the initializer seems constant

2014-12-12 Thread Luca Bruno
On 12/12/2014 15:57, Nicolas CARRIER wrote:
>
> That's an interesting bug. I think vala threats that -1 as unary
> operator of negation. Should be trivial to fix. Feel free to report a
> bug.
>
> ---
>
> Ok ! Thank for the explanation.
>
> I haven't used bugzilla yet. I will try to submit my first bug ASAP.
>
No need to, fixed in master. Nice catch, thanks.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] unused variable warning in generated C code

2014-12-12 Thread Nicolas CARRIER

From: Luca Bruno 
To: vala-list gnome org

>On 12/12/2014 14:18, Nicolas CARRIER wrote:
>
>
>The problem is that when I compile vala code with the warning
>compilations flags our build system enables, I have a lot of warnings.
>This one is only one amongst others.
>The risk is high to miss a real one in the mass...
>
>If it's the case that a warning is a bug in the generated code, then
>it's a bug in vala.

In fact, I'm talking about C warnings due to errors in my vala code.

>
>
>Is it planned to "cleanup" this aspect of the generated C code ?
>
>Yes, not a priority as those warnings can be ignored. But I accept patches.

Ok, I will give a try, but I can't guarantee the result ^^

>
>Concerning the other warnings I have, do you think it's worth it to
>submit them to the mailing list ? Or will the answers be of the same
>kind ?
>
>This is the mailing list, you meant bugzilla?

No, I wasn't clear enough, sorry but my english isn't as good as I'd like it to 
be.

I was asking if it would be interesting to send the warnings to the mailing, in 
order to find out if they are caused by errors in my vala code, or not.
Generally speaking, shall I ignore all C warnings if valac issues no warning in 
the vala code himself ?

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


Re: [Vala] error: Non-constant field initializers, but the initializer seems constant

2014-12-12 Thread Luca Bruno
On 12/12/2014 15:57, yannick inizan wrote:
>
> Declaration are allowed outside classe/struct or fonction ?
>
Yes.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Problem using Mysql in Vala (Fedora 21): /usr/bin/ld: cannot find -lmysqlclient

2014-12-12 Thread AxP

Hello,

I tried to use MySQL today with Vala but ran into some Problems. I 
searched for some solutions but couldn't fix the issue. I saw a few 
threads on the list with a similar problem but it didn't help me.
First I was trying to get 
http://www.fromdual.com/mysql-vala-program-example working, now it's 
only this short snippet:



using Mysql;

static int main(string[] args) {

Database mysql = new Mysql.Database();

return 0;
}


Problem is that I get this message in return:
valac "main.vala" --pkg mysql -X -lmysqlclient (im Verzeichnis: 
/home/axp/Dokumente/Workspaces/10 Vala/MailServer/src)
main.vala:5.14-5.41: warning: local variable `mysql' declared but 
never used

Database mysql = new Mysql.Database();
 
/usr/bin/ld: cannot find -lmysqlclient
collect2: Fehler: ld gab 1 als Ende-Status zurück
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)
Kompilierung fehlgeschlagen.


I think that there could be problem with my setup. I've done:

yum install mysql-server
yum install mysql-devel

So the libraries and headers are installed and new.

Compilation with valac -c "%f" --pkg mysql -X -lmysqlclient is working.
But really creating the little program with valac "%f" --pkg mysql -X 
-lmysqlclient fails.


I thought this could be a nice opportunity to try the mailing list. I 
hope the problem is not too trivial and I'm the only one who doesn't 
know the solution :B

Thank you in advance!
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] error: Non-constant field initializers, but the initializer seems constant

2014-12-12 Thread yannick inizan
Declaration are allowed outside classe/struct or fonction ?
Le 12 déc. 2014 15:38, "Luca Bruno"  a écrit :

> On 12/12/2014 15:31, Nicolas CARRIER wrote:
> > namespace Plop {
> > int my_int = -1;
> > static void check_my_int_is_initialized() {
> > if (my_int < 0)
> > my_int = 42;
> > }
> > public static int main(string[] args) {
> > check_my_int_is_initialized();
> > stdout.printf(@"my_int is $my_int\n");
> > return 0;
> > }
> > }
> That's an interesting bug. I think vala threats that -1 as unary
> operator of negation. Should be trivial to fix. Feel free to report a bug.
> ___
> 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] error: Non-constant field initializers, but the initializer seems constant

2014-12-12 Thread Nicolas CARRIER

From: Luca Bruno 
To: vala-list gnome org

On 12/12/2014 15:31, Nicolas CARRIER wrote:

namespace Plop {
int my_int = -1;
static void check_my_int_is_initialized() {
if (my_int < 0)
my_int = 42;
}
public static int main(string[] args) {
check_my_int_is_initialized();
stdout.printf(@"my_int is $my_int\n");
return 0;
}
}

That's an interesting bug. I think vala threats that -1 as unary
operator of negation. Should be trivial to fix. Feel free to report a bug.

---

Ok ! Thank for the explanation.

I haven't used bugzilla yet. I will try to submit my first bug ASAP.

PS: I don't receive the mails from the mailing list, it's really annoying, I 
have to copy / paste from the mailing-list's site in order to answer...

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


Re: [Vala] error: Non-constant field initializers, but the initializer seems constant

2014-12-12 Thread Luca Bruno
On 12/12/2014 15:31, Nicolas CARRIER wrote:
> namespace Plop {
> int my_int = -1;
> static void check_my_int_is_initialized() {
> if (my_int < 0)
> my_int = 42;
> }
> public static int main(string[] args) {
> check_my_int_is_initialized();
> stdout.printf(@"my_int is $my_int\n");
> return 0;
> }
> } 
That's an interesting bug. I think vala threats that -1 as unary
operator of negation. Should be trivial to fix. Feel free to report a bug.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] error: Non-constant field initializers, but the initializer seems constant

2014-12-12 Thread Nicolas CARRIER

Hello,
I have this kind of pattern in my code:

namespace Plop {
int my_int = -1;
static void check_my_int_is_initialized() {
if (my_int < 0)
my_int = 42;
}
public static int main(string[] args) {
check_my_int_is_initialized();
stdout.printf(@"my_int is $my_int\n");
return 0;
}
}

and when I try to compile it, I get the following error:
$ valac main.vala
main.vala:2.2-2.11: error: Non-constant field initializers not supported in this 
context

int my_int = -1;
^^
Compilation failed: 1 error(s), 0 warning(s)

I don't understand the issue, because I would've though that -1 is a constant 
value. Isn't it the case for vala ? Or is it an inadequate error message for 
another error which I am missing ?


Thank you in advance !
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] unused variable warning in generated C code

2014-12-12 Thread Luca Bruno
On 12/12/2014 14:18, Nicolas CARRIER wrote:
>
> The problem is that when I compile vala code with the warning
> compilations flags our build system enables, I have a lot of warnings.
> This one is only one amongst others.
> The risk is high to miss a real one in the mass...
If it's the case that a warning is a bug in the generated code, then
it's a bug in vala.
>
> Is it planned to "cleanup" this aspect of the generated C code ?
>
Yes, not a priority as those warnings can be ignored. But I accept patches.
> Concerning the other warnings I have, do you think it's worth it to
> submit them to the mailing list ? Or will the answers be of the same
> kind ?
This is the mailing list, you meant bugzilla?
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] unused variable warning in generated C code

2014-12-12 Thread Nicolas CARRIER



Date: Fri, 12 Dec 2014 10:54:53 +0100
From: Luca Bruno 

On 12/12/2014 10:46, Nicolas CARRIER wrote:

Hello,
When I compile the following code :

public static int main(string[] args) {
 int[] b = { 2, 4, 6, 8 };
 foreach (int a in b)
 stdout.printf("%d\n", a);
 return 0;
}

with :

$ valac -C main.vala
$ gcc -Wunused-variable main.c -o main $(pkg-config --cflags --libs
glib-2.0)


I get the following warning :
main.c: In function ?_vala_main?:
main.c:38:8: attention : unused variable ?_a_collection_size_?
[-Wunused-variable]
gint _a_collection_size_ = 0;
 ^
What is the reason for this warning ?

Valac not clever enough to delete unused C variables.


Is it possible to get rid of it ?

Yes, ignore C warnings. Or fix vala, in this case it's not easy so I
don't suggest doing it :)



Thank you for your answer.
The problem is that when I compile vala code with the warning compilations flags 
our build system enables, I have a lot of warnings. This one is only one amongst 
others.

The risk is high to miss a real one in the mass...

Is it planned to "cleanup" this aspect of the generated C code ?

It would be interesting to dig into the code myself, but for now, I am not 
sufficiently skilled in vala, so it would take too much time I think.



Concerning the other warnings I have, do you think it's worth it to submit them 
to the mailing list ? Or will the answers be of the same kind ?


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


Re: [Vala] acr 0.9.9

2014-12-12 Thread rastersoft

Hi:

It looks like something similar to my project Autovala. Maybe we can 
merge both, allowing autovala to generate both cmake and 
autoconf/automake scripts...


El 12/12/14 a las 02:00, pancake escribió:
I'm almost ready to release a new version of ACR. My own autoconf 
replacement tool.


  https://github.com/radare/acr

In this release I have fixed some bugs and added support for Vala.

The way to configure a Vala project with ACR is the following:

$ cat configure.acr
PKGNAME myvala
VERSION 0.1
CONTACT name ; m...@host.org

LANG_VALA!
VALAPKG posix
VALAPKG gtk+-3.0

PKGCFG CS_CFLAGS CS_LDFLAGS capstone

SUBDIRS config.vala ;

REPORT
HAVE_VALA
HAVE_VALAC
VALAC
HAVE_VALAPKG_POSIX
HAVE_VALAPKG_GTK_3_0
HAVE_LANG_VALA
VALA_VERSION ;

$ cat config.vala.acr
public static string VERSION = "@@VERSION@@";

$ acr


And now you have a fully functional ./configure script that behaves 
like the
GNU one but its way smaller and faster. It's still a shellscript, so 
there are

no portability issues or extra dependencies to build the project.

$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for working directories... current
using prefix '/usr/local'
checking vala compiler... valac
checking vala... vala
checking valac --pkg posix... yes
checking valac --pkg gtk+-3.0... yes
checking pkg-config flags for capstone... no
creating config.vala
cleaning temporally files... done

Final report:
 - HAVE_VALA = 1
 - HAVE_VALAC = 1
 - VALAC = valac
 - HAVE_VALAPKG_POSIX = 1
 - HAVE_VALAPKG_GTK_3_0 = 1
 - HAVE_LANG_VALA = 1
 - VALA_VERSION = 0.26


$ ./configure --report
PKGNAME:   myvala
VERSION:   0.1
LANGS: vala
PKG-CONFIG:  posix gtk+-3.0 capstone
FLAGS: --with-vala=vala --with-valac=valac



The AMR (automake replacement) is still work in progress and doesnt 
yet supports

Vala projects. But I think parvala can be used quite nicely here.

I have also plans to add another keyword LICENSE to include the COPYRIGHT
statements in the same directory, this makes maintaining projects 
easier, but
the compilation part is what I'll try to address with amr in next 
versions.


It is possible to extend the fucntionality of the configure.acr with 
conditionals
or external scripts. But it tries to keep everything as compact as 
possible.


Let me know if you try it and find any interesting task

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



--
Nos leemos
 RASTER(Linux user #228804)
ras...@rastersoft.com  http://www.rastersoft.com

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


Re: [Vala] acr 0.9.9

2014-12-12 Thread Max
Have you looked at autovala project? Seems pretty similar, although from the
description it looks like autovala is more complete solution ATM.

https://github.com/rastersoft/autovala

cheers,
Max.

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


Re: [Vala] acr 0.9.9

2014-12-12 Thread Dmitry Golovin
I really like you project and probably going to use it.

12.12.2014, 03:05, "pancake" :
> I'm almost ready to release a new version of ACR. My own autoconf
> replacement tool.
>
>    https://github.com/radare/acr
>
> In this release I have fixed some bugs and added support for Vala.
>
> The way to configure a Vala project with ACR is the following:
>
> $ cat configure.acr
> PKGNAME myvala
> VERSION 0.1
> CONTACT name ; m...@host.org
>
> LANG_VALA!
> VALAPKG posix
> VALAPKG gtk+-3.0
>
> PKGCFG CS_CFLAGS CS_LDFLAGS capstone
>
> SUBDIRS config.vala ;
>
> REPORT
>  HAVE_VALA
>  HAVE_VALAC
>  VALAC
>  HAVE_VALAPKG_POSIX
>  HAVE_VALAPKG_GTK_3_0
>  HAVE_LANG_VALA
>  VALA_VERSION ;
>
> $ cat config.vala.acr
> public static string VERSION = "@@VERSION@@";
>
> $ acr
>
> And now you have a fully functional ./configure script that behaves like the
> GNU one but its way smaller and faster. It's still a shellscript, so
> there are
> no portability issues or extra dependencies to build the project.
>
> $ ./configure
> checking build system type... x86_64-unknown-linux-gnu
> checking host system type... x86_64-unknown-linux-gnu
> checking target system type... x86_64-unknown-linux-gnu
> checking for working directories... current
> using prefix '/usr/local'
> checking vala compiler... valac
> checking vala... vala
> checking valac --pkg posix... yes
> checking valac --pkg gtk+-3.0... yes
> checking pkg-config flags for capstone... no
> creating config.vala
> cleaning temporally files... done
>
> Final report:
>   - HAVE_VALA = 1
>   - HAVE_VALAC = 1
>   - VALAC = valac
>   - HAVE_VALAPKG_POSIX = 1
>   - HAVE_VALAPKG_GTK_3_0 = 1
>   - HAVE_LANG_VALA = 1
>   - VALA_VERSION = 0.26
>
> $ ./configure --report
> PKGNAME:   myvala
> VERSION:   0.1
> LANGS: vala
> PKG-CONFIG:  posix gtk+-3.0 capstone
> FLAGS: --with-vala=vala --with-valac=valac
>
> The AMR (automake replacement) is still work in progress and doesnt yet
> supports
> Vala projects. But I think parvala can be used quite nicely here.
>
> I have also plans to add another keyword LICENSE to include the COPYRIGHT
> statements in the same directory, this makes maintaining projects
> easier, but
> the compilation part is what I'll try to address with amr in next versions.
>
> It is possible to extend the fucntionality of the configure.acr with
> conditionals
> or external scripts. But it tries to keep everything as compact as possible.
>
> Let me know if you try it and find any interesting task
>
> --pancake
> ___
> 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] unused variable warning in generated C code

2014-12-12 Thread Luca Bruno
On 12/12/2014 10:46, Nicolas CARRIER wrote:
> Hello,
> When I compile the following code :
>
> public static int main(string[] args) {
> int[] b = { 2, 4, 6, 8 };
> foreach (int a in b)
> stdout.printf("%d\n", a);
> return 0;
> }
>
> with :
>
> $ valac -C main.vala
> $ gcc -Wunused-variable main.c -o main $(pkg-config --cflags --libs
> glib-2.0)
>
>
> I get the following warning :
> main.c: In function ‘_vala_main’:
> main.c:38:8: attention : unused variable ‘_a_collection_size_’
> [-Wunused-variable]
>gint _a_collection_size_ = 0;
> ^
> What is the reason for this warning ?
Valac not clever enough to delete unused C variables.

> Is it possible to get rid of it ?
Yes, ignore C warnings. Or fix vala, in this case it's not easy so I
don't suggest doing it :)
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] unused variable warning in generated C code

2014-12-12 Thread Nicolas CARRIER

Hello,
When I compile the following code :

public static int main(string[] args) {
int[] b = { 2, 4, 6, 8 };
foreach (int a in b)
stdout.printf("%d\n", a);
return 0;
}

with :

$ valac -C main.vala
$ gcc -Wunused-variable main.c -o main $(pkg-config --cflags --libs glib-2.0)


I get the following warning :
main.c: In function ‘_vala_main’:
main.c:38:8: attention : unused variable ‘_a_collection_size_’ 
[-Wunused-variable]
   gint _a_collection_size_ = 0;
^
What is the reason for this warning ?
Is it possible to get rid of it ?


PS: valac --version gives Vala 0.26.1.

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