NetXMS Support Forum

Development => General => Topic started by: Benjamin Dill on November 24, 2024, 09:01:25 PM

Title: mariadb.h missing?
Post by: Benjamin Dill on November 24, 2024, 09:01:25 PM
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
Title: Re: mariadb.h missing?
Post by: Alex Kirhenshtein on November 25, 2024, 01:43:56 PM
I'm pretty much sure it's part of the mariadb connector:

#include "mysql.h"
#include "errmsg.h"
Title: Re: mariadb.h missing?
Post by: Benjamin Dill on November 25, 2024, 01:53:41 PM
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?
Title: Re: mariadb.h missing?
Post by: Victor Kirhenshtein on November 25, 2024, 06:23:59 PM
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

Title: Re: mariadb.h missing?
Post by: Benjamin Dill on November 25, 2024, 07:11:11 PM
Victor, thank you very much! I should have realized this myself...