Visual C ++ MySQL Connector / C错误?

问题描述

| 我的源代码导致:
// MySQL.cpp : Defines the entry point for the console application.
//

#include <iostream>
#include <winsock.h>
#include <string>
#include <sstream>
#include <stdio.h>
#include <mysql.h>

#define TABLE_OF_INTEREST \"some_table\"
#define SERVER_NAME \"mysql_server\"
#define DB_USER \"user\"
#define DB_USERPASS \"pa55w0rd\"
#define DB_NAME \"db_name\"
#define NEWLINE \"\\n\"

using namespace std;

int main()
{
    MYSQL *hnd = NULL; // mysql connection handle
    const char *sinf = NULL; // mysql server information 
    if(!mysql_real_connect(hnd,SERVER_NAME,DB_USER,DB_USERPASS,DB_NAME,NULL,0)
        cout << \"Something happened.\";
    return 0;
}
错误:
1>------ Build started: Project: MySQL,Configuration: Release Win32 ------
1>  MySQL.cpp
1>MySQL.obj : error LNK2001: unresolved external symbol _mysql_real_connect@32
1>c:\\users\\josiah\\documents\\visual studio 2010\\Projects\\MySQL\\Release\\MySQL.exe : fatal error LNK1120: 1 unresolved external
========== Build: 0 succeeded,1 failed,0 up-to-date,0 skipped ==========
我认为源不存在问题,我仅需要有关如何确定问题出在哪里的帮助。     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)