BUG: L2029 When Using struct with "volatile" Keyword

ID: Q104244

7.00 | 1.00 1.50 MS-DOS | WINDOWS kbprg kbbuglist

The information in this article applies to:

SYMPTOMS

A communal (that is, global and uninitialized) structure declaration of a variable with the "volatile" type qualifier is not resolved at link time. The result is an unresolved external (L2029 error) on the declared variable. For example, if the following code

   struct a { int x; } volatile v;

   main() {
     v.x=3;
   }

is placed in a TEST.C file and is compiled with the default compiler and linker options, the linker will return:

   error L2029: '_v' : unresolved external

RESOLUTION

Use one of the following three workarounds:

STATUS

Microsoft has confirmed this to be a bug in C/C++ versions 7.0 and 8.0 for MS-DOS and C/C++ version 7.0 for OS/2. This problem does not occur with the Microsoft Visual C++ 32-bit edition.

Additional reference words: 1.00 1.50 1.00 7.00 8.00 8.00c KBCategory: kbprg kbbuglist KBSubcategory: CLIss Keywords : kb16bitonly

Last Reviewed: July 23, 1997