windows下访问MySQL出错
环境:win7/Code::Blocks 10.05
准备工作:在调试之前我将MySQL Server 5.6include文件夹的内容全部拷贝到CodeBlocks10.05MinGWinclude下了。
代码:
#include <iostream> #include <mysql.h> using namespace std; int main() { cout << "Hello world!" << endl; return 0; }
编译报错:
error: 'SOCKET' does not name a type
求解
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
国外的处理答复,把winsock.h include加载在mysql.h之前来修正这个错误。。。要学会看国外的资料啊
You will have to include winsock.h before including mysql.h to fix this error. See the below link for more details:
国外的处理答复,把winsock.h include加载在mysql.h之前来修正这个错误。。。要学会看国外的资料啊
You will have to include winsock.h before including mysql.h to fix this error. See the below link for more details:
国外的处理答复,把winsock.h include加载在mysql.h之前来修正这个错误。。。要学会看国外的资料啊
You will have to include winsock.h before including mysql.h to fix this error. See the below link for more details: