News:

We really need your input in this questionnaire

Main Menu

mariadb.h missing?

Started by Benjamin Dill, November 24, 2024, 09:01:25 PM

Previous topic - Next topic

Benjamin Dill

I'm building from source and I'm failing at the MariaDB database driver, because I can't find "mariadb.h". There is a comment about "your own wrapper header", thus I'm assuming this is not part of the MariaDB library.
Is this file missing in the repo? 

https://github.com/netxms/netxms/blob/1d3c9de01bf9df8a07189aebc4b5973c679dd206/src/db/dbdrv/mariadb/mariadbdrv.h#L50C11-L50C20

Alex Kirhenshtein

I'm pretty much sure it's part of the mariadb connector:

#include "mysql.h"
#include "errmsg.h"

Benjamin Dill

Im talking about this:
#ifdef _WIN32
// Include our own wrapper header on Windows to avoid conflict with MySQL client library
#include <mariadb.h>
#else
I see mysql.h included MariaDB library, but not mariadb.h?

Victor Kirhenshtein

Because we have both MySQL client and MariaDB client on common include path (MySQL going first) during Windows build, we cannot use
#include <mysql.h>
in MariaDB driver as it will pick up header file from MySQL client. So we creat simple header file called mariadb.h and place it besides mysql.h from MariaDB client:
#include "mysql.h"
#include "errmsg.h"

Best regards,
Victor


Benjamin Dill

Victor, thank you very much! I should have realized this myself...