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
Read More:
- Error c2137 of C language: empty character constant (Fixed)
- The use of Chinese characters in Qt and the solution to the “error C2001: newline in constant” problem
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- error C2137: empty character constant
- Solutions to error c2143: syntax error: missing ‘;’ before ‘type’ in C + + program compilation
- winnt.h C2146 error C2146: syntax error : missing ‘;’ before identifier ‘PVOID64’
- Expected unqualified ID before numeric constant
- Solution to the flash of running result of dev C / C + +
- C error C2143 syntax error missing before ‘type’
- Solution to the problem of no C / C + + option in the new project of eclipse
- error C2146: syntax error : missing ‘;’ before identifier ‘fd’
- Error c2061: syntax error: identifier ‘this_ FILE’
- Error C2664 in C + + compilation: cannot convert parameter 2 from “const char [5]” to “lpctstr” solution.
- C language string processing error warning, c4996, sprintf, predicted, c4996, strcpy, c4996, strcat
- Expected unqualified ID before string constant
- syntax error near unexpected token `then’ problem solution
- Error c2143: syntax error: missing ‘;’ before ‘type’
- Solution to syntaxerror: invalid syntax in PIP install XXX
- A fatal error C1083 occurred when compiling C + + code under. Net: unable to open the include file: “xuhk”_ Jnihelloworld. H “: solution to no such file or directory error.
- error C2061: syntax error : identifier ‘BinryTreeNode’