I have this very short program. For some reason mysql_init always returns null for me. According to the documentation, this happens if there isn't enough memory. How can this be? It's just these few lines of code.
#include "mysql.h"
int main()
{
MYSQL * mysql;
mysql = mysql_init(0);
// here mysql is 0
return 0;
}
I use Visual Studio 2015 and the lib from mariadb-10.1.8-win32.zip .
edit: I made it work a bit. I was compiling with debug Settings in visual Studio and linked to libmysqld.lib. I also copies libmysqld.dll in the work dir. That resulted in the ffect I describe above. I tried to link to libmysql.lib and copies libmysql.dll to the work dir and that worked. I don't plan to debug mysql code, so I can live with that. It's still strange though why the debug lib doesn't work for the same code.