Microsoft KB Archive/198018

= PRB: ATL Project Named "ATL" Fails to Build =

Article ID: 198018

Article Last Modified on 9/12/2003

-

APPLIES TO

 Microsoft ActiveX Template Library 3.0, when used with:  Microsoft Visual C++ .NET 2002 Standard Edition

 Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Standard Edition</li></ul>

 Microsoft Visual C++ .NET 2003 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q198018

<div class="symptoms_section">

SYMPTOMS
When you build an ATL project with the name 'ATL' you will

C2370: 'LIBID_ATLLib' : redefinition; different storage class c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(79) : see declaration of 'LIBID_ATLLib'

The project can be an inproc server, local server or service and the project name's case does not matter.

In Visual Studio .NET you receive the following error message:

ATL_i.obj : error LNK2005: _LIBID_ATLLib already defined in stdafx.obj ATL_i.obj : warning LNK4006: _LIBID_ATLLib already defined in stdafx.obj; second definition ignored

Creating library Debug/ATL.lib and object Debug/ATL.exp Debug/ATL.dll : fatal error LNK1169: one or more multiply defined symbols found

<div class="cause_section">

CAUSE
When you create a ATL project with the name 'ATL', the type library is give a name ATLLib and the midl generated header files generates a GUID named LIBID_ATLLib. This GUID name is already used in the ATL header files and so the redefinition error. ATL uses the GUID name for the registrar object and the control containment code.

<div class="resolution_section">

RESOLUTION

 * 1) In the <project_name>.idl file change the name of the library from

ATLLib to something else.


 * 1) Do not use 'ATL' for your project name.

<div class="moreinformation_section">

Steps to Reproduce Behavior

 * 1) In the Visual C++ IDE click on 'File | New' menu.
 * 2) In the resulting dialog, click on 'Project' tab and select 'ATL COM

AppWizard'.
 * 1) In the 'Project Name' edit box, type the name 'ATL' and click on 'OK'

button.
 * 1) In the 'ATL COM AppWizard' choose any option and build the project. You

should see the above error.

Additional query words: kbDSupport

Keywords: kbprb KB198018

-

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

© Microsoft Corporation. All rights reserved.