Bug #47056 my_socket in VC
Submitted: 2 Sep 2009 10:01 Modified: 2 Sep 2009 11:52
Reporter: zhou chaogu Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version: OS:Windows (XP)
Assigned to: CPU Architecture:Any
Tags: my_socket

[2 Sep 2009 10:01] zhou chaogu
I just used the mysql C api in my Visual studio 2005.but I found that the my_socket won't compile.I add " #include <Winsock2.h> " in the mysql.h.add it work.I think it's a simple bug.

How to repeat:
just add "#include <Winsock2.h>" in mysql.h! And it work.
[2 Sep 2009 11:52] MySQL Verification Team
Thank you for the bug report. Please follow the instructions documented in the below item of Manual:


2.10.7. Compiling MySQL Clients on Windows

In your source files, you should include my_global.h before mysql.h:

#include <my_global.h>
#include <mysql.h>

my_global.h includes any other files needed for Windows compatibility (such as windows.h) if you compile your program on Windows.