Article ID: 88092 - Last Review: July 5, 2005 - Revision: 2.1 BUG: Cannot Access Static Data Members in Inline AssemblyThis article was previously published under Q88092 On This PageSYMPTOMS
When trying to access static data members in a C++ program with inline
assembly, the compiler may report the following errors:
error C2420: 'identifier' : illegal symbol in first operand 1
error C2415: improper operand type
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. MORE INFORMATION
To access the static data member, assign the address of the data member to
a temporary variable. The inline assembler can then access the data by
loading the address from the temporary variable.
Below is code that demonstrates the problem and workaround. Sample CodeAPPLIES TO
| Article Translations
|

Back to the top
