none
Simple syntax error c2059 & c3805 combined for one line of code in "binary_log_types.h" -need some guide

    Question

  • Dear VS expert out there:

    Simple syntax error c2059 & c3805 on one source code line from the library is causing so much confusion.

    Researched through google and Window Edge, could not find any hint to resolve the problem I faced as below:

    Thanking you in advance,

    CBO

    typedef enum enum_field_types {

                                            ….

                                            ….

                                     56     MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,

                                     57     MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,

                                     58     MYSQL_TYPE_BIT=  ,  

                                     59      MYSQL_TYPE_TIMESTAMP=       ,

                                     60     MYSQL_TYPE_DATETIME=       ,

                                     61     MYSQL_TYPE_TIME=       ,

                                     62    

                                     63      MYSQL_TYPE_JSON=         ,

                                         ….

                                         ….

                               } enum_field_types;

     

    1>c:\users\chanb\documents\programming\common code\binary_log_types.h(58): error C2059: syntax error: ','

    1>c:\users\chanb\documents\programming\common code\binary_log_types.h(58): error C3805: ',': unexpected token, expected either '}' or a ','


    cbo

    Tuesday, January 17, 2017 11:58 PM

Answers

All replies

  • Hi poosung,

    According to your description, this issue may be caused by your code.  Please refer to my following code:

    #define MON  1
    #define TUE   2
    #define WED  3
    #define THU   4
    #define FRI    5
    #define SAT   6
    #define SUN   7
    typedef enum workday
    {
           saturday,
           sunday = 0,
           monday,
           tuesday,
           wednesday,
           thursday,
           friday
    } workday;

    Please make sure all letters have been typed in English :)

    And whether your issue is the same as your previous thread with the following link ? I suggest that you type the code manually.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/5da0d97d-35b3-468e-b499-4576095984c2/compiler-error-in-vs-on-mysqlconnectionh-file?forum=visualstudiogeneral#f3ec547b-82c3-4fb0-8413-bb580b1230bc

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by qing__Moderator Wednesday, January 18, 2017 5:07 AM
    • Marked as answer by poosung Wednesday, January 18, 2017 12:39 PM
    Wednesday, January 18, 2017 5:05 AM
    Moderator
  • Hi, Oscar,

    What a clear example you showed me.   I did get the hint, and so, I put "0" without quote mark

    and a comma following.  e.g. MYSQL_TYPE_JSON= 0,
           MYSQL_TYPE_NEWDECIMAL= 0,
           MYSQL_TYPE_ENUM= 0,
           MYSQL_TYPE_SET= 0,

    I think compiler took it ok.   But I am not sure this header from MYSQL will work with this

    correction.   Anyway, great guide for which I thank you very much.


    cbo

    Wednesday, January 18, 2017 12:39 PM
  • Hi poosung,

    This forum is talking about some questions about how to use Visual Studio.

    >>But I am not sure this header from MYSQL will work with this correction.

    I suggest you could post this question to the C++ forum:

    Visual Studio Languages, Windows Desktop Development  >  Visual C++

    I think this forum will give you a professional answer :)

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 19, 2017 2:07 AM
    Moderator