step1:我下载了mysql server 5并安装完成
step2:我下载了mysql 源代码文件。
step3:将源代码文件里的include下的所有文件(绝大部分是.h文件)
step4:将这些.h文件拷贝到c:/program files/microsoft visual studio/vc/include里面
step5:打开vc++6.0 ,写了一个程序(从书上抄来的),编译运行,报错,说mysql_com.h出错!有4错
step6:琢磨半天,束手无策。
step7:发帖求救!!
step8:;……………………
step2:我下载了mysql 源代码文件。
step3:将源代码文件里的include下的所有文件(绝大部分是.h文件)
step4:将这些.h文件拷贝到c:/program files/microsoft visual studio/vc/include里面
step5:打开vc++6.0 ,写了一个程序(从书上抄来的),编译运行,报错,说mysql_com.h出错!有4错
step6:琢磨半天,束手无策。
step7:发帖求救!!
step8:;……………………
附上我的程序源码:
#include <stdio.h>
#include <mysql.h>
#include <iostream>
#define def_host_name NULL
#define def_user_name NULL
#define def_password NULL
#define def_port_num 0
#define def_socket_name NULL
#define def_db_name NULLMYSQL *conn;
int main( int argc,char *argv[])
{ conn = mysql_init(NULL); if(conn==NULL)
{
fprintf(stderr,"mysql_init() failed (probaly out of memory)\n");
exit(1);
}
if(mysql_real_connect(
conn,
def_host_name,
def_user_name,
def_password,
def_db_name,
0,
NULL,
0)
==NULL)
{
fprintf(stderr,"mysql_real_connect() failed:\nError %u (%s)\n",
mysql_errno(conn),mysql_error(conn));
exit(1);
}
mysql_close(conn);
exit(0);
}
老兄,你编译试试?你的源代码在哪里下的啊?小弟先谢了
在stdafx.h 中加上上面的一条