You receive an LNK4197 error in the 64-bit version of the Visual C++ Compiler (835326)
The information in this article applies to:
- Microsoft Windows Server 2003 Driver Development Kit (DDK)
- the operating system: Microsoft Windows Server 2003, 64-Bit Enterprise Edition
- the operating system: Microsoft Windows Server 2003, 64-Bit Datacenter Edition
SUMMARYWhen you build a DLL by using the 64-bit version of the Microsoft Visual C++ Compiler and Linker, you may receive Linker error number LNK4197 if a function has been declared for export more than one time.SYMPTOMSThe Linker output may be similar to the following: C:\>link /NOLOGO /def:Sample.def /pdb:Sample.pdb /out:Sample.dll Sample.obj
Sample.obj : warning LNK4197: export 'DllSample' specified multiple times; using first specification
Creating library Sample.lib and object Sample.exp CAUSEThe Linker error number LNK4197 is generated when a function has been declared for export more than one time. A function is declared for export in one of the following ways: This Linker error may occur most frequently when both the __declspec(dllexport) keyword and a .DEF file are used to define the same function name in a .DLL project. RESOLUTIONTo resolve this behavior, define exported functions only one time, either by using the __declspec(dllexport) keyword or by using a .DEF file. Do not use both of these methods.STATUS This behavior is by design.MORE INFORMATIONDeclaring a function for export more than one time may not produce the Linker error that is described in the "Symptoms" section of this article in 32-bit versions of the Microsoft Windows C++ Compiler and Linker. However, Microsoft recommends that you define function exports only one time in both 32-bit and 64-bit versions of the Windows C++ Compiler and Linker.
Modification Type: | Major | Last Reviewed: | 3/1/2004 |
---|
Keywords: | kbDDK kbprb KB835326 kbAudDeveloper |
---|
|