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



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!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]