error C2146: syntax error : missing ‘;’ before identifier ‘fd’

Compiler error: error C2146: Syntax error: Missing ‘; ‘ before identifier ‘fd’
Follow up my_socket FD in mySQL_com.h file; /* For Perl DBI/ DBD */ line, found that the compiler does not recognize my_socket, but my_socket is defined in mysql.h: #define my_socket SOCKET, so the next is the SOCKET definition. SOCKET definition is in Winsock2.h, but with the predefined # IFDEF ___, the header winsock2.h is not included at all.
Solution: In #include< mysql.h> With # include< winsock2.h> Can!

Read More: