The information in this article applies to:
SYMPTOMSWhen compiling a program that uses the _inp and _outp instructions and links with the DLL version of the CRT, you will see one or more of the following errors:
CAUSEThe _inp and _outp functions are not exported from the DLL versions of the C Run-time Library (CRT), and do not exist in those versions of the CRT. If you try to use these functions with the DLL version of the CRT, you will get LNK2001 errors. RESOLUTION
There are several ways to get around the LNK2001 errors:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Visual C++, 32-bit Edition, version 4.1. MORE INFORMATIONYou can avoid the linker errors by using a #pragma intrinsic instruction that will replace the _inp and _outp function calls with their assembly equivalents. In each file that refers to the _inp or _outp instruction, add the following line:
A similar method that can be used to avoid the link errors is to turn on
intrinsic function optimizations for all intrinsic functions. If you
are using the Command Line compiler, adding the /Oi switch to the
compile options will enable intrinsic function optimizations. To turn
on this optimization within Developer Studio, perform the following
steps:
Q140584 How to Link with the Correct C Run-Time (CRT) Library Additional query words: 4.00
Keywords : kbCRT kbVC |
Last Reviewed: August 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |