Sqlapi error: Error c2146: syntax error: Missing '; 'before identifier' FD'

Source: Internet
Author: User
I tried sqlapi today and used the MySQL database. An error was found during compilation:

  1. Error 1 error c2146: syntax error: Missing '; 'before identifier' FD 'd:/sqlapi/mysql_com.h 192
  2. Error 2 error c4430: Missing type specifier-int assumed. Note: C ++ does not support default-int D:/sqlapi/mysql_com.h 192
  3. Error 3 error c4430: Missing type specifier-int assumed. Note: C ++ does not support default-int D:/sqlapi/mysql_com.h 192
  4. Error 4 error c2065: 'socket ': Undeclared identifier D:/sqlapi/mysql_com.h 367
  5. Error 5 Error c2146: syntax error: Missing ') 'Before identifier's 'd:/sqlapi/mysql_com.h 367
  6. Error 6 error c2059: syntax error: ') 'd:/sqlapi/mysql_com.h 368

The solution is simple:
Include winsock2.h before myapi. h.

As follows:

  1. # Include "stdafx. H"
  2. # Include <winsock2.h>
  3. # Include "myapi. H"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.