[Maria-discuss] (/usr/include/mysql and libmysqlclient) vs (/usr/include/mariadb libmariadbclient and libmariadb)
First, let me clarify everything here is MariaDB - nothing actually involving the MySQL code. In Arch Linux, I'm running a MariaDB server and client. I installed the mariadb package, built from the source at: http://ftp.heanet.ie/mirrors/mariadb/mariadb-10.1.18/source/mariadb-10.1.18.... This provides: - /usr/include/mysql/* (141 .h files) - /usr/lib/libmysqlclient.so - /usr/lib/libmysqld.so (I see this is for embedding a MariaDB server in an application which I don't need, so I'll ignore that for the rest of my message.) I have C++ applications that will access MariaDB, and I thought I also needed mariadb-connector-c, so I built tag v2.3.1 at https://github.com/MariaDB/mariadb-connector-c This provides: - /usr/include/mariadb/* (40 .h files) - /usr/lib/mariadb/libmariadbclient.a - /usr/lib/mariadb/libmariadb.so Q1 - What's the purpose and difference between libmysqlclient, libmariadbclient, and libmariadb? (Ignoring difference shared vs static library.) Q2 - /usr/include/mysql/mysql.h (from http://ftp.heanet.ie/mirrors/mariadb/mariadb-10.1.18/source/mariadb-10.1.18....) and /usr/include/mariadb/mysql.h (from tag v2.3.1 at from https://github.com/MariaDB/mariadb-connector-c) Are quite similar and have a lot of identical code, but are also way different. I ran into that /usr/include/mysql/mysql.h defines: const char * STDCALL mysql_error(MYSQL * myql); But /usr/include/mariadb/mysql.h defines: char * STDCALL mysql_error(MYSQL *mysql); (Note the missing const on the return value.) I got very confused at this point why the same function is declared in each, why they're different, which I should be using, etc.
Hi, james! On Oct 03, james harvey wrote:
First, let me clarify everything here is MariaDB - nothing actually involving the MySQL code.
In Arch Linux, I'm running a MariaDB server and client. I installed the mariadb package, built from the source at:
http://ftp.heanet.ie/mirrors/mariadb/mariadb-10.1.18/source/mariadb-10.1.18....
This provides: - /usr/include/mysql/* (141 .h files) - /usr/lib/libmysqlclient.so - /usr/lib/libmysqld.so (I see this is for embedding a MariaDB server in an application which I don't need, so I'll ignore that for the rest of my message.)
I have C++ applications that will access MariaDB, and I thought I also needed mariadb-connector-c, so I built tag v2.3.1 at
No, you doesn't. See below
https://github.com/MariaDB/mariadb-connector-c
This provides: - /usr/include/mariadb/* (40 .h files) - /usr/lib/mariadb/libmariadbclient.a - /usr/lib/mariadb/libmariadb.so
Q1 -
What's the purpose and difference between libmysqlclient, libmariadbclient, and libmariadb? (Ignoring difference shared vs static library.)
libmariadbclient.a is a static version of libmariadb.so. both are the MariaDB Connector/C - new LGPL MariaDB/MySQL client library, see https://mariadb.com/kb/en/mariadb/mariadb-connector-c/ libmysqlclient is the old GPL MariaDB/MySQL client library. It's no longer developed, all new features go into MariaDB Connector/C. libmysqlclient is removed in 10.2 Either way, you need either libmysqlclient or libmariadb, you should not link with both at the same time.
I got very confused at this point why the same function is declared in each, why they're different, which I should be using, etc.
Use either one, but not both. Regards, Sergei Chief Architect MariaDB and security@mariadb.org
participants (2)
-
james harvey
-
Sergei Golubchik