APPNOTE: Patch, Allocate, Mixed-Language Windows ProgrammingLast reviewed: February 16, 1996Article ID: Q78522 |
The information in this article applies to:
SUMMARYThis application note corrects the unresolved externals that may occur when linking a mixed-language Windows program using FORTRAN and C. If the FORTRAN code uses the ALLOCATE statement, LINK may generate the following errors:
LINK : error L2029: Unresolved external: _hfree LINK : error L2029: Unresolved external: _hmallocTo obtain the application note "PATCH: Allocate in Mixed-Language Windows Programming," call Microsoft Product Support Services. This application note is also available in the Microsoft Software Library. Download HF0484.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
MORE INFORMATIONThe following is the text of the application note:
Microsoft Product Support Services Application Note (Text File) HF0484: PATCH: ALLOCATE IN MIXED-LANGUAGE WINDOWS PROGRAMMING Revision Date: 11/91 Disk IncludedThe following information applies to FORTRAN version 5.1.
-------------------------------------------------------------------- | INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY | | ACCOMPANY THIS DOCUMENT (collectively referred to as an | | Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY | | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO | | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A | | PARTICULAR PURPOSE. The user assumes the entire risk as to the | | accuracy and the use of this Application Note. This Application | | Note may be copied and distributed subject to the following | | conditions: 1) All text must be copied without modification and | | all pages must be included; 2) If software is included, all files | | on the disk(s) must be copied without modification [the MS-DOS(R) | | utility DISKCOPY is appropriate for this purpose]; 3) All | | components of this Application Note must be distributed together; | | and 4) This Application Note may not be distributed for profit. | | | | Copyright 1991 Microsoft Corporation. All Rights Reserved. | | Microsoft, MS-DOS, and the Microsoft logo are registered | | trademarks and Windows is a trademark of Microsoft Corporation. | --------------------------------------------------------------------This application note corrects a problem that occurs when you link a mixed-language Windows program using FORTRAN and C. If the FORTRAN code uses the ALLOCATE statement, LINK generates two errors:
LINK : error L2029: Unresolved external: _hfree LINK : error L2029: Unresolved external: _hmallocThe errors are caused by the absence of several routines in the C- compatible FORTRAN run-time library. To correct this problem, you must add to the C-compatible FORTRAN run-time library the three object modules that are included on the enclosed HF0484 disk.
Modifying the C-Compatible FORTRAN Run-Time LibraryTo make the correction to the C-compatible FORTRAN run-time library, copy the following three object modules from the enclosed HF0484 disk to the directory where your FORTRAN library is located:
WHALLOC.OBJ WHSEG.OBJ HMAP.OBJThen, enter the following command
LIB <LIBNAME.LIB> + WHALLOC.OBJ + WHSEG.OBJ + HMAP.OBJ;where <LIBNAME.LIB> represents the name of the C-compatible FORTRAN run-time library you want to modify. You can then delete the three object modules from the library directory. The library manager will make a backup file named <LIBNAME.BAK>. When the new library has been tested successfully, you can also delete this backup file.
|
Additional reference words: 5.10 HF0484.EXE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |