PRB: Error L2029 for __aseglo, __aseghi Linking Application

Last reviewed: July 17, 1997
Article ID: Q93006
6.00 6.00a 6.00ax 7.00 | 1.00 1.50
MS-DOS                 | WINDOWS
kbtool kbprb

The information in this article applies to:

   The Microsoft C/C++ Compiler (CL.EXE) included with:
    - Microsoft C for MS-DOS, versions 6.0, 6.0a, 6.0ax
    - Microsoft C/C++ for MS-DOS, version 7.0
    - Microsoft Visual C++ for Windows, versions 1.0 and 1.5

SYMPTOMS

During the process of creating an application for the Windows environment using the /Zr compiler option switch, the Microsoft Linker generates the following error messages:

   error L2029: '__aseghi' : unresolved external
   error L2029: '__aseglo' : unresolved external

These errors occur using the run-time libraries from the Windows Software Development Kit (SDK) version 3.0 or the Microsoft C 6.0 Run-time Libraries from the Windows SDK version 3.1. These errors do not occur when the code is compiled with Microsoft C/C++ version 7.0 and linked with the libraries in the Windows SDK version 3.1.

CAUSE

This is expected behavior. The /Zr switch is designed for use with applications compiled for the MS-DOS environment.

RESOLUTION

Do not use the /Zr switch when compiling code for the Windows environment regardless of the C compiler or Windows SDK version used.

MORE INFORMATION

When an MS-DOS application runs, it is loaded into one contiguous block of memory. When the /Zr option is used, the compiler adds code to determine if pointers point to memory above or below this block of memory and signals an error if this condition is detected. In the Windows environment, an application is not loaded into a contiguous memory block. Also, during execution, segments may move in memory. These factors prevent the MS-DOS pointer validation method from working correctly in the Windows environment.

Because the method the compiler employs when the /Zr switch is specified does not work in the Windows environment, the C run-time libraries for the Windows 3.0 environment do not define the __aseglo and __aseghi symbols which causes the Linker to generate the errors listed above. Because the C run-time libraries for Windows 3.1 define __aseglo and __aseghi, no L2029 error is generated. However, these symbols should not be used.


Additional reference words: 1.00 1.50 6.00 6.00a 6.00ax 7.00 8.00 8.00c
null pointer
KBCategory: kbtool kbprb
KBSubcategory: CLIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.