MySQL and C++ lib error

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

1
2
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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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;
}
Last edited on
bump
anyone?
Topic archived. No new replies allowed.