首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

VC连接MYSQL出现有关问题

2012-03-08 
VC连接MYSQL出现问题我装的是MYSQL4。0。23版本的,libmysql.dlllibmysql.lib等都按要求设置好了。但是只要一

VC连接MYSQL出现问题
我装的是MYSQL4。0。23版本的,libmysql.dll     libmysql.lib等都按要求设置好了。但是只要一加上#include   <mysql.h> 就会报错,而且错误是在mysql_com.h里,不知道什么原因。
下面是错误提示。请大侠过来指导一下。谢谢!


G:\MySQL数据库存取例子代码\MySQL\mysql_com.h(116)   :   error   C2146:   syntax   error   :   missing   '; '   before   identifier   'fd '
G:\MySQL数据库存取例子代码\MySQL\mysql_com.h(116)   :   error   C2501:   'SOCKET '   :   missing   storage-class   or   type   specifiers
G:\MySQL数据库存取例子代码\MySQL\mysql_com.h(116)   :   error   C2501:   'fd '   :   missing   storage-class   or   type   specifiers
G:\MySQL数据库存取例子代码\MySQL\mysql_com.h(180)   :   error   C2065:   'SOCKET '   :   undeclared   identifier
G:\MySQL数据库存取例子代码\MySQL\mysql_com.h(180)   :   error   C2146:   syntax   error   :   missing   ') '   before   identifier   's '
G:\MySQL数据库存取例子代码\MySQL\mysql_com.h(181)   :   error   C2059:   syntax   error   :   ') '
G:\MySQL数据库存取例子代码\MySQL\MySQL.h(110)   :   fatal   error   C1083:   Cannot   open   include   file:   'my_alloc.h ':   No   such   file   or   directory
Generating   Code...
Error   executing   cl.exe.

MySQL.exe   -   14   error(s),   0   warning(s)

[解决办法]
wsock32.lib需要吗?
[解决办法]
#ifdef __LCC__
#include <winsock.h> /* For windows */
#endif

我用的是5.0,看看头文件里的代码,是需要wsock32.lib的
[解决办法]

http://blog.csdn.net/hzhxxx/
[解决办法]
找不到头文件吧,查下位置

热点排行