ERROR : 'EBADMSG' was not declared in this scope

62 Views Asked by At

I am trying to connect C++ with SQL Plus database. In Code::Blocks, it throws an error when running:

ERROR : 'EBADMSG' was not declared in this scope.
#include <iostream>
#include <Windows.h>
#include <mysql.h>
#include <iomanip>
#include <stdlib.h>
#include <sstream>
#include <stdio.h>
#include <errno.h>

using namespace std;

int main()

{
    MYSQL* conn;
    conn = mysql_init(0);
    conn = mysql_real_connect(conn, "localhost", "root", "", "MaBD", 0, NULL, 0);
    if (conn)
    {
    }

    else
    {
        cout <<" Connection failure"<<endl;
    }

    return 0;
}
0

There are 0 best solutions below