I have visual studio 10 and mysql workbench installed.I have created a new win32 console application project and to include the files done the following:
in project properties under c/c++ -> general
, I have added C:\Program Files\MySQL\MySQL Server 5.6\include
in linker -> general -> additional library directories
I have added C:\Program Files\MySQL\MySQL Server 5.6\lib
in linker -> general -> input -> additional dependencies
I have added libmysql.lib
i have copied libmysql.lib to system32 folder.
#include<iostream>
#include<my_global.h>
#include<mysql.h>
MYSQL* con=mysql_init(NULL);
MYSQL_RES* result;
the above code gives the following error->
error LNK2019: unresolved external symbol _mysql_init@4 referenced in function "void __cdecl `dynamic initializer for 'con''(void)" (??__Econ@@YAXXZ)
1>c:\users\dell\documents\visual studio 2010\Projects\dmrc2\Debug\dmrc2.exe : fatal error LNK1120: 1 unresolved externals