简体   繁体   中英

MASM 14: constant expected in winextra.inc

There is an opinion on the Inte.net that these errors are a trouble in MSVC 2019. However I not found how to solve this problem except advice to install another version of MASM.

winextra.inc from include:

; ...
STD_ALERT struct
    alrt_timestamp dd ?
    alrt_eventname WCHAR  [EVLEN + 1] dup(?)  ; Here is A2026
    alrt_servicename WCHAR [SNLEN + 1] dup(?) ; Here is A2026
STD_ALERT ends
; ...

So how to solve errors A2026 in winextra without reinstallation MASM to another version?

Older versions of MASM accepted the syntax. The newer versions require replacing the square brackets with parentheses.

; ...
STD_ALERT struct
    alrt_timestamp dd ?
    alrt_eventname WCHAR  (EVLEN + 1) dup(?)  ; Corrected
    alrt_servicename WCHAR (SNLEN + 1) dup(?) ; Corrected
STD_ALERT ends
; ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM