Microsoft KB Archive/832729

= BUG: &quot;LNK2005&quot; linker error message when you build the TextInterpreter sample project =

Article ID: 832729

Article Last Modified on 1/17/2006

-

APPLIES TO


 * Microsoft Visual C++ 2005 Express Edition
 * Microsoft Visual C++ .NET 2003 Standard Edition
 * Microsoft Visual C++ .NET 2002 Standard Edition
 * Microsoft Visual Studio Industry Partner Software Development Kit

-





Note Microsoft Visual C++ .NET 2002 and Microsoft Visual C++ .NET 2003 support both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code. Microsoft Visual C++ 2005 supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model.



SYMPTOMS
When you build the TextInterpreter sample project that is included with the Microsoft Visual Studio Industry Partner Software Development Kit (VSIP SDK), you may receive the following linker error message:

LNK2005: &quot;long __stdcall ATL::AtlWinModuleInit(struct ATL::_ATL_WIN_MODULE70 *)&quot; (?AtlWinModuleInit@ATL@@YGJPAU_ATL_WIN_MODULE70@1@@Z) already defined in ad2de.lib(dbgmetric.obj)



CAUSE
The Use of ATL configuration property is incorrectly set to Not Using ATL in the TextInterpreter sample project although it is a Microsoft Active Template Library (ATL) project.



RESOLUTION
Change the Use of ATL configuration property from Not Using ATL to Dynamic Link to ATL. To do this, follow these steps:
 * 1) Install the Microsoft Visual Studio Industry Partner Software Development Kit (VSIP SDK).
 * 2) Start Microsoft Visual Studio .NET 2002, Microsoft Visual Studio .NET 2003, or Microsoft Visual Studio 2005.
 * 3) On the File menu, point to Open, and then click Project.
 * 4) In the Open Project dialog box, locate the TextInterpreter sample project that is installed on your computer where you installed the VSIP SDK samples.

You can find the TextInterpreter sample in the \Microsoft Visual Studio Debugging SDK\Debugging SDK Samples\Text Interpreter Sample directory. is a placeholder for the drive where the VSIP SDK is installed.
 * 1) Click to select the TextInterpreter project or workspace file, and then click Open.
 * 2) In the Visual C++ Project dialog box, click Yes to convert the project to the format that Visual Studio .NET or Visual Studio 2005 uses.
 * 3) In Solution Explorer, right-click the TextInterpreter project node, and then click Properties.
 * 4) In the TextInterpreter Property Pages dialog box, expand Configuration Properties, and then expand C/C++.
 * 5) Click General, and then type the path for the include files of the TextInterpreter sample project in the Additional Include Directories box.

You can find these files in the \Microsoft Visual Studio Debugging SDK\Includes directory. is a placeholder for the drive where the VSIP SDK is installed.
 * 1) Collapse the C/C++ folder, and then expand the Linker folder.
 * 2) Click General, and then type the directory path for the library files of the TextInterpreter sample project in the Additional Library directories box.

You can find these files in the \Microsoft Visual Studio Debugging SDK\Libs directory. is a placeholder for the drive where the VSIP SDK is installed.
 * 1) Collapse the Linker folder, and then click General in the Configuration Properties folder.
 * 2) Change the Use of ATL property on the right side from Not Using ATL to Dynamic Link to ATL.
 * 3) Click Apply, and then click OK to close the TextInterpreter Property Pages dialog box.
 * 4) Press CTRL+SHIFT+B to build the TextInterpreter sample project. The sample project builds successfully.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section of this article.

Additional query words: LNK2005 Linker Error, VSIP SDK, ATL Sample Error, TextInterpreter, Industry Partner

Keywords: kberrmsg kbbug kbatlserver kbdirectory kbproperties kbmigrate kbconversion kbmigration KB832729

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.