Tag Archives: Equipment docking

Error c2059: syntax error: constant solution

Scene

      Add the header file and library file of Haikang and Yushi SDKs. Error c2059: syntax error: “constant”. The macro definition in netdevsdk. H header file of UTV SDK is abnormal
displayed   typedef enum tagNETDEV_ PASSIVEDECODE_ CMD
 {
   PASSIVE_ DEC_ PAUSE = 1,    /* Passive decoding pause (file stream only valid) */
0    PASSIVE_ DEC_ RESUME = 2,    /* Recover passive decoding (only valid for file stream) */
0    PASSIVE_ DEC_ FAST = 3,    /* Fast passive decoding (only valid for file stream) */
1    PASSIVE_ DEC_ SLOW = 4,    /* Slow passive decoding (file stream only valid) */
1    PASSIVE_ DEC_ NORMAL = 5,    /* Normal passive decoding (file stream only valid) */
0    PASSIVE_ DEC_ ONEBYONE = 6,    /* Passive decoding single frame playback (reserved) */
1    PASSIVE_ DEC_ AUDIO_ ON = 7,    /* Audio on */
1    PASSIVE_ DEC_ AUDIO_ OFF = 8,    /* Audio off */
1    PASSIVE_ DEC_ RESETBUFFER = 9     /* Clear buffer */
0  } NETDEV_ PASSIVEDECODE_ CMD_ E;

Netdevsdk. H (5082): error c2059: syntax error: “constant”
netdevsdk. H (5091): error c2143: syntax error: missing “;”( Before “}”

Mouse on passive_ DEC_ Pause, see the error prompt: # define         PASSIVE_ DEC_ PAUSE             one

Investigation process               Macro definition search for the whole project directory in Notepad + +_ DEC_ Pause, found that hcnetsdk. H
?Define has been defined in the header file of Haikang         PASSIVE_ DEC_ PAUSE             one     /* Passive decoding pause (file stream only valid) */
?Define         PASSIVE_ DEC_ RESUME             two     /* Recover passive decoding (only valid for file stream) */
?Define      PASSIVE_ DEC_ FAST               three    /* Fast passive decoding (file stream only) */
?Define      PASSIVE_ DEC_ SLOW             four    /* Slow passive decoding (file stream only valid) */
?Define      PASSIVE_ DEC_ NORMAL           five    /* Normal passive decoding (file stream only valid) */
?Define      PASSIVE_ DEC_ ONEBYONE           six   /* Passive decoding single frame playback (reserved) */
?Define      PASSIVE_ DEC_ AUDIO_ ON          seven    /* Audio on */
?Define      PASSIVE_ DEC_ AUDIO_ OFF         eight        /* Audio off */
?Define         PASSIVE_ DEC_ RESETBUFFER         nine     /* Clear the buffer */
so the above prompt error appears

Solution

             Netdev is not found in the header file of UTV SDK_ PASSIVEDECODE_ CMD_ E macro definition, therefore, the entire macro definition is annotated directly to solve the problem