> Hi,
> i'm trying mysql bindings now, and it doesn't work for me,
>
> r...@centos-54-64-minimal ~/develop/vala # valac --pkg mysql mysql2.vala &&
> ./mysql2
> mysql2.vala:10.19-10.33: error: `Mysql.Database' does not have a default
> constructor
> Database mysql = new Database ();
> ^^^^^^^^^^^^^^^
> Compilation failed: 1 error(s), 0 warning(s)
>
>
> i've read maillist and it seem like a common error on later versons of
> vala? :(
I'm not so sure why this worked in the first place. You could try the
attached patch which makes init a static factory method:
var mysql = Database.init();
--- /home/jens/checkout/gnome2/vala/vapi/mysql.vapi 2009-04-08 22:20:46.000000000 +0200
+++ /opt/gnome2/share/vala/vapi/mysql.vapi 2010-01-13 18:18:32.000000000 +0100
@@ -26,8 +26,7 @@
[Compact]
[CCode (free_function = "mysql_close", cname = "MYSQL", cprefix = "mysql_")]
public class Database {
- [CCode (argument0 = "NULL", cname = "mysql_init")]
- public void init ();
+ public static Database? init (Database? db=null);
public ulong affected_rows ();
public bool autocommit (bool mode);
_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list