在用mfc连接mysql时出现如下错误:
1>staffDlg.obj : error LNK2019: unresolved external symbol _mysql_error@4 referenced in function "protected: virtual int __thiscall CstaffDlg::OnInitDialog(void)" (?OnInitDialog@CstaffDlg@@MAEHXZ)
1>staffDlg.obj : error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function "protected: virtual int __thiscall CstaffDlg::OnInitDialog(void)" (?OnInitDialog@CstaffDlg@@MAEHXZ)
1>staffDlg.obj : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function "protected: virtual int __thiscall CstaffDlg::OnInitDialog(void)" (?OnInitDialog@CstaffDlg@@MAEHXZ)
1>D:\Programming Software\vs2010\ImportProjects\staff\Debug\staff.exe : fatal error LNK1120: 3 unresolved externals
求各位大侠帮忙解决下啊……先谢了
1>staffDlg.obj : error LNK2019: unresolved external symbol _mysql_error@4 referenced in function "protected: virtual int __thiscall CstaffDlg::OnInitDialog(void)" (?OnInitDialog@CstaffDlg@@MAEHXZ)
1>staffDlg.obj : error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function "protected: virtual int __thiscall CstaffDlg::OnInitDialog(void)" (?OnInitDialog@CstaffDlg@@MAEHXZ)
1>staffDlg.obj : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function "protected: virtual int __thiscall CstaffDlg::OnInitDialog(void)" (?OnInitDialog@CstaffDlg@@MAEHXZ)
1>D:\Programming Software\vs2010\ImportProjects\staff\Debug\staff.exe : fatal error LNK1120: 3 unresolved externals
求各位大侠帮忙解决下啊……先谢了
if(!mysql_real_connect(&mysql,"localhost","root","091606","info",3306,NULL,0))
{
AfxMessageBox("数据库连接失败");
AfxMessageBox( mysql_error(&mysql));
return FALSE;
}
include和lib路径都加进去了 #pragma comment(lib, "libmysql.lib")也加到项目中了 就是运行时出现上述错误 求帮忙啊……