vs2013运行时找不到mysql.h头文件

sinat_16985427 2015-11-19 02:22:35
#ifndef MYSQLDBACCESS_H
#define MYSQLDBACCESS_H

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <mysql>

using namespace std;

typedef map<string, string> Record;
typedef map<string, string>::iterator RecordIter;

typedef vector<Record> Table;
typedef vector<Record>::iterator TableIter;

typedef vector<string> Fields;
typedef vector<string>::iterator FieldsIter;

class User;

class MysqlDBAccess
{
public:
MysqlDBAccess(){isSeverConnected = isDBConnected = false;}
~MysqlDBAccess(){if(isSeverConnected) DisconnentSever();}
bool ConnectSever(string severName, string userName, string pwd="", int port=3306); //连接服务器
void DisconnentSever(void){mysql_close(mysql);}
bool ConnectDB(string dbName); //连接数据库
bool ExcuteSQL(string sql); //执行语句
int SDelectRecord(string selectSQL); //执行查寻诗句并显示查寻内容

int ChrRecord(char *name,char *pwd,int &ID); //用户名密码验证
void mysqldbinit(MysqlDBAccess &sql); //数据库初始化
int GetRecord(char *str,int ID);

friend class User;

protected:
int GetFields(Fields & fields);
void DisplayTable(Fields fd,Table dt);

private:
MYSQL *mysql;
MYSQL_RES *result;
MYSQL_ROW row;
MYSQL_FIELD *field;

bool isSeverConnected;
bool isDBConnected;
string dbName;
};



#endif

1>------ Build started: Project: pos, Configuration: Debug Win32 ------
1> user.cpp
1>c:\users\administrator\desktop\pos\mysqldb.h(8): fatal error C1083: Cannot open include file: 'mysql': No such file or directory
1> mysqldb.cpp
1>c:\users\administrator\desktop\pos\mysqldb.h(8): fatal error C1083: Cannot open include file: 'mysql': No such file or directory
1> main.cpp
1>c:\users\administrator\desktop\pos\mysqldb.h(8): fatal error C1083: Cannot open include file: 'mysql': No such file or directory
...全文
476 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2015-11-20
  • 打赏
  • 举报
回复
mysql和mysql.h不是一回事! 关于自己是否适合编程的很简单的测试: 在报纸或杂志上随便找一段约1000字的文章,在Word中输入一遍。输完后再参考下面答案: A里面有10处以上文字或标点错误 B里面没有文字或标点错误并敢为此跟人打赌 C里面没有文字或标点错误并且字体和排版完全与原稿一致 D打印在半透明的纸上和原稿重叠在一起检查一模一样,且自我感觉很有成就感 A不适合编程(理由:打字准确度偏低、粗心大意) B初级程序员(理由:打字准确度很高、认真细致、自信、理解全角半角概念) C高级程序员(理由:在B的基础上理解字体和排版也是电脑打印的重要因素、但相比D还不够偏执、精益求精、结果可验证) D软件项目经理(理由:能针对项目给出令人信服的细致到极点的需求说明和典型测试用例。用户几乎挑不出毛病。专业!) 如果想从A变成B的话,到我的资源http://download.csdn.net/detail/zhao4zhong1/4084259里面下载“适合程序员的键盘练习”
707wk 2015-11-19
  • 打赏
  • 举报
回复
没有mysql.h头文件
sinat_16985427 2015-11-19
  • 打赏
  • 举报
回复
能不能说得具体点,新手完全摸不着北
paschen 2015-11-19
  • 打赏
  • 举报
回复
属性中设置包含目录路径、源目录路径,另查看是否确有这个文件
sinat_16985427 2015-11-19
  • 打赏
  • 举报
回复
电脑装了phpstudy和vs2013想共用一个数据库可以吗

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧