1. I downloaded win installer
2. installed "FULL" version
3. added programfiles/mysql/include dir
4. added programfiles/mysql/lib dir
5. linked "libmysql.lib"
still getting
Code:
1>Source.obj : error LNK2001: unresolved external symbol _mysql_real_connect@32
1>Source.obj : error LNK2001: unresolved external symbol _mysql_init@4
looks like the lib is for 64 bit (I guess), but I downloaded 32 bit installer and im compiling it for 32 bit, any suggestions? im using vs2012
code:
Code:
#include <my_global.h>
#include <mysql.h>
#include <iostream>
#include <string>
using namespace std;
#define DB_HOST "localhost"
#define DB_USER "root"
#define DB_PASS "root"
#define DB_DB "test"
#define DB_PORT 3306
int main()
{
MYSQL *conn;
conn = mysql_init(NULL);
if(conn = mysql_real_connect(conn, DB_HOST, DB_USER, DB_PASS, DB_DB, DB_PORT, NULL, 0))
{
}
else
cout << "Cant connect to the DB" << endl;
system("pause");
return 0;
}
I have 64 bit OS, vs2012 express, compiling for 32 bit, I downloaded 32 bit mysql installer